V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
alexapollo
V2EX  ›  程序员

Scrapy: 爬取豆瓣书籍 //以及几个简单实例

  •  
  •   alexapollo ·
    geekan · 2014-02-01 12:21:30 +08:00 · 8040 次点击
    这是一个创建于 3757 天前的主题,其中的信息可能已经有所发展或是发生改变。
    源码: https://github.com/geekan/scrapy-examples
    这个工程是为了 http://www.oschina.net/code/snippet_1026739_25291 的改写而试手的作品,依赖Scrapy爬虫框架。
    现在有几个基本的爬虫:douban书籍爬取,linkedin的公共资料爬取,以及几个很有用的入门tutorial。
    截图: https://raw2.github.com/geekan/resource_collection/master/image/doubanbook.jpg
    11 条回复    1970-01-01 08:00:00 +08:00
    faceair
        1
    faceair  
       2014-02-01 12:23:14 +08:00
    要做图书馆数据整合,刚巧用得上,谢~
    alexapollo
        2
    alexapollo  
    OP
       2014-02-01 12:28:06 +08:00   ❤️ 1
    @faceair 哈哈~ 大恩不言谢,红包呢!
    alexapollo
        3
    alexapollo  
    OP
       2014-02-01 21:19:22 +08:00
    更新了hrtencent的爬取~
    lincanbin
        4
    lincanbin  
       2014-02-01 23:31:39 +08:00
    上个月写过一个爬豆瓣读书的,为了整合一个图书馆系统。
    豆瓣读书有一个现成的API,Response是JSON格式,非常方便。
    alexapollo
        5
    alexapollo  
    OP
       2014-02-02 00:31:58 +08:00
    @lincanbin 多谢回复。有看过API,但这个工程也仅是为了练Scrapy :)
    bearcat001
        6
    bearcat001  
       2014-02-02 09:55:38 +08:00
    你用递归了吗?scrapy如何做递归比较舒服...?
    我一直再用yield Request,可控性不高
    alexapollo
        7
    alexapollo  
    OP
       2014-02-02 10:43:29 +08:00
    @bearcat001 递归的目的是?爬整站吗?我原来写了一套递归系统,但感觉Rule还挺好用,就都废弃了
    funcman
        8
    funcman  
       2014-02-03 02:50:43 +08:00
    豆瓣的数据根本不值得爬。
    alexapollo
        9
    alexapollo  
    OP
       2014-02-03 10:16:46 +08:00   ❤️ 1
    @funcman Example而已。。
    funcman
        10
    funcman  
       2014-02-03 13:44:38 +08:00
    @alexapollo 是对想弄图书馆数据的一楼说的。
    robertlyc
        11
    robertlyc  
       2014-02-04 12:21:22 +08:00
    豆瓣有api提供
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   6135 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:36 · PVG 10:36 · LAX 19:36 · JFK 22:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.