• 大小: 15KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-08-25
  • 语言: Python
  • 标签: Python源码  

资源简介

豆瓣电影、书籍、小组、相册、东西等爬虫集 writen by Python. PS: 哎, 八个月后自己尝试设计了下爬虫框架, 感觉doubanspiders代码简直糟蹋了Scrapy, 阿弥陀佛! 依赖服务 MongoDB 依赖包 pip install scrapy pip install pybloom pip install pymongo 运行豆瓣电影爬虫 进入douban/movie目录 执行scrapy crawl movie 运行豆瓣相册爬虫 进入douban/album目录 执行scrapy crawl album

资源截图

代码片段和文件信息

#encoding: utf-8
from scrapy import Field Item

#豆瓣相册 文档格式
AlbumItem = dict(
    from_url = “http://www.douban.com/photos/album/135640217/“
    album_name = “少年听雨歌楼上,壮年画雨客舟中“
    author = dict(
        home_page = “http://www.douban.com/people/isotherm/“
        nickname = “等温线“
        avatar = “http://img3.douban.com/icon/u2152074-7.jpg“
    )
    photos = [
        dict(
            large_img_url = “http://img3.douban.com/view/photo/photo/public/p2192138220.jpg“
            like_count = 2
            recommend_count = 22
            desc = “李子哒粉蒸排骨!好吃!“
            comments = [
                dict(
                    avatar = “http://img3.douban.com/icon/u42419518-2.jpg“
                    nickname = “muse“
                    post_datetime = “2014-07-29 08:37:14“
                    content = “看得流口水了“
                    home_page = “http://www.douban.com/people/yijuns89/“
                )
            ]
        )
    ]
    tags = [“美女“ “标签“ “时尚“]
    recommend_total = 67
    like_total = 506
    create_date = “2014-07-21“
    photo_count = 201
    follow_count = 37
    desc = “蛇蛇蛇 马马马“


class AlbumItem(Item):
    album_name = Field()
    author = Field()
    photos = Field()
    recommend_total = Field()
    like_total = Field()
    create_date = Field()
    from_url = Field()
    photo_count = Field()
    follow_count = Field()
    desc = Field()
    tags = Field()


class PhotoItem(Item):
    large_img_url = Field()
    like_count = Field()
    recommend_count = Field()
    desc = Field()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-03-29 13:46  doubanspiders-master\
     文件          12  2015-03-29 13:46  doubanspiders-master\.gitignore
     文件         510  2015-03-29 13:46  doubanspiders-master\README.md
     目录           0  2015-03-29 13:46  doubanspiders-master\douban\
     目录           0  2015-03-29 13:46  doubanspiders-master\douban\album\
     文件           0  2015-03-29 13:46  doubanspiders-master\douban\album\__init__.py
     文件        1663  2015-03-29 13:46  doubanspiders-master\douban\album\items.py
     目录           0  2015-03-29 13:46  doubanspiders-master\douban\album\misc\
     文件           0  2015-03-29 13:46  doubanspiders-master\douban\album\misc\__init__.py
     文件         694  2015-03-29 13:46  doubanspiders-master\douban\album\misc\bloomfilter.py
     文件         299  2015-03-29 13:46  doubanspiders-master\douban\album\misc\helper.py
     文件         611  2015-03-29 13:46  doubanspiders-master\douban\album\misc\middlewares.py
     文件         140  2015-03-29 13:46  doubanspiders-master\douban\album\misc\store.py
     文件        5717  2015-03-29 13:46  doubanspiders-master\douban\album\parsers.py
     文件           0  2015-03-29 13:46  doubanspiders-master\douban\album\pipelines.py
     文件         245  2015-03-29 13:46  doubanspiders-master\douban\album\scrapy.cfg
     文件         739  2015-03-29 13:46  doubanspiders-master\douban\album\settings.py
     目录           0  2015-03-29 13:46  doubanspiders-master\douban\album\spiders\
     文件           0  2015-03-29 13:46  doubanspiders-master\douban\album\spiders\__init__.py
     文件        2396  2015-03-29 13:46  doubanspiders-master\douban\album\spiders\album.py
     目录           0  2015-03-29 13:46  doubanspiders-master\douban\movie\
     文件           0  2015-03-29 13:46  doubanspiders-master\douban\movie\__init__.py
     文件        2339  2015-03-29 13:46  doubanspiders-master\douban\movie\items.py
     目录           0  2015-03-29 13:46  doubanspiders-master\douban\movie\misc\
     文件           0  2015-03-29 13:46  doubanspiders-master\douban\movie\misc\__init__.py
     文件         694  2015-03-29 13:46  doubanspiders-master\douban\movie\misc\bloomfilter.py
     文件         299  2015-03-29 13:46  doubanspiders-master\douban\movie\misc\helper.py
     文件         611  2015-03-29 13:46  doubanspiders-master\douban\movie\misc\middlewares.py
     文件         140  2015-03-29 13:46  doubanspiders-master\douban\movie\misc\store.py
     文件         375  2015-03-29 13:46  doubanspiders-master\douban\movie\pipelines.py
     文件         247  2015-03-29 13:46  doubanspiders-master\douban\movie\scrapy.cfg
............此处省略4个文件信息

评论

共有 条评论