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

你们都用什么来做爬虫的

  •  
  •   xdeng · 2013-03-12 09:18:53 +08:00 · 17979 次点击
    这是一个创建于 4034 天前的主题,其中的信息可能已经有所发展或是发生改变。
    你们都用什么语言来做爬虫的,有什么好的介绍。。。
    第 1 条附言  ·  2013-03-13 09:28:01 +08:00
    有没有c/c++的..................
    48 条回复    2018-11-30 18:50:29 +08:00
    for4
        1
    for4  
       2013-03-12 09:22:08 +08:00   ❤️ 4
    Python
    +requests
    +lxml
    +celery
    xdeng
        2
    xdeng  
    OP
       2013-03-12 09:31:03 +08:00
    @for4 -.-! 要学这么多东西啊
    for4
        3
    for4  
       2013-03-12 09:36:30 +08:00
    @xdeng
    第一个是编程语言
    后面三个是可能需要用到的库

    这是我认为的写一个爬虫最简单易学的搭配
    xieren58
        4
    xieren58  
       2013-03-12 09:40:41 +08:00
    Node + jquery
    liuxurong
        5
    liuxurong  
       2013-03-12 09:41:46 +08:00
    我是 requests + pyquery

    另外
    @for4 celery通常用来做什么
    xdeng
        6
    xdeng  
    OP
       2013-03-12 09:54:04 +08:00
    @xieren58
    @liuxurong 这个网站里的全都是 做网页的么
    shinwood
        7
    shinwood  
       2013-03-12 10:03:05 +08:00   ❤️ 2
    试过python + Scrapy,感觉不错。

    http://scrapy.org/
    greatghoul
        8
    greatghoul  
       2013-03-12 10:13:34 +08:00
    @shinwood 这个用起来的确骚爽。
    colincat
        9
    colincat  
       2013-03-12 10:13:35 +08:00 via Android
    java
    for4
        10
    for4  
       2013-03-12 10:14:06 +08:00   ❤️ 1
    @liuxurong
    我是把爬虫的各个功能部分分成小任务, 然后按需放入任务队列中. 这样既能有效的降低爬虫的复杂度, 同时用队列也能提高爬虫的稳健度, 比如失败重做.
    还有, 使用celery后你的爬虫就变成分布式的了, 可以简单的布置在多台机器上跑
    wingoo
        11
    wingoo  
       2013-03-12 10:53:32 +08:00
    scrapy
    twm
        12
    twm  
       2013-03-12 10:55:26 +08:00
    JAVA PHP
    dulao5
        13
    dulao5  
       2013-03-12 17:40:21 +08:00
    PHP + curl_multi_*

    不过以后应该尝试nodejs了,并发容易实现,解析页面里的js更有优势。
    xjay
        14
    xjay  
       2013-03-12 20:05:01 +08:00
    scrapy
    不解释
    PrideChung
        15
    PrideChung  
       2013-03-12 20:09:22 +08:00
    ruby+norogiri
    http://nokogiri.org/
    amxku
        16
    amxku  
       2013-03-12 20:30:18 +08:00
    Python
    +curl
    +celery
    1up
        17
    1up  
       2013-03-12 20:36:18 +08:00
    cloverstd
        18
    cloverstd  
       2013-03-12 21:14:19 +08:00
    Python: urllib, urllib2, re
    sobigfish
        19
    sobigfish  
       2013-03-12 22:18:01 +08:00
    前几天 用nodejs写个玩,但不知道怎么部署在只有web服务的 PaaS上-,-
    cheerio很好用阿,完全是jQuery的语法。

    require('http');require('cheerio');require('iconv').Iconv;require('mongodb');
    chuck911
        20
    chuck911  
       2013-03-12 22:34:53 +08:00
    还有人写个爬虫还非要用芹菜...

    Scrapy爽是因为它基于事件驱动的Twisted,我以前也很爱Scrapy,后来用上Node写爬虫就感觉从重型土炮换到了肩扛火箭筒
    atom
        21
    atom  
       2013-03-12 23:34:32 +08:00
    @twm
    @colincat
    同为javaer,能否推荐下是哪个库?
    sohoer
        22
    sohoer  
       2013-03-13 00:38:28 +08:00
    @atom
    JAVA?
    HttpURLConnection + Regex = Spider
    Linxing
        23
    Linxing  
       2013-03-13 01:23:03 +08:00 via Android
    python beautifulsoup urlib爬文章
    liuxurong
        24
    liuxurong  
       2013-03-13 01:55:37 +08:00
    @for4 谢谢。有没有celery的中文资料
    crazybubble
        25
    crazybubble  
       2013-03-13 04:34:27 +08:00   ❤️ 1
    @atom 用regex来做html parsing不推荐,我推荐用jsoup。
    colincat
        26
    colincat  
       2013-03-13 08:03:06 +08:00 via iPhone
    @sohoer htmlparse httpclient
    workaholic
        27
    workaholic  
       2013-03-13 08:04:13 +08:00   ❤️ 1
    php+snoopy
    akalanala
        28
    akalanala  
       2013-03-13 08:48:24 +08:00
    @crazybubble 同推荐.
    binux
        29
    binux  
       2013-03-13 09:21:19 +08:00
    python + tornado AsyncHTTPClient + PyQuery
    sonicwu
        30
    sonicwu  
       2013-03-13 09:24:32 +08:00
    Java
    + jsoup

    Python
    + Beautiful Soup
    + urllib
    + lxml
    dingyaguang117
        31
    dingyaguang117  
       2013-03-13 10:05:15 +08:00
    Python
    + Beautiful Soup
    + lxml
    + Scrapy
    atom
        32
    atom  
       2013-03-13 13:59:52 +08:00
    @crazybubble
    是个很棒的库,看到 http://try.jsoup.org/ 我就喜欢上它了
    zoran
        33
    zoran  
       2013-03-14 13:12:55 +08:00
    Java 可以试试这个 https://github.com/zhuoran/crawler4j
    yangxin0
        34
    yangxin0  
       2013-03-14 13:42:31 +08:00
    看过别人用C
    Xrong
        35
    Xrong  
       2013-03-14 18:43:04 +08:00
    希望大家给推荐PHP的,毕业设计打算用这玩意写;都说用PHP写不大方便,但是还是希望大伙有写过的,提供源码参考下,有在线资源的也行。
    zdwalter
        36
    zdwalter  
       2013-03-15 16:21:50 +08:00
    phantomjs, casperjs
    zhouquanbest
        37
    zhouquanbest  
       2013-03-16 18:17:38 +08:00
    python + pyquery 是个好东西
    会jquery就能写
    nojt7Zm
        38
    nojt7Zm  
       2013-03-17 21:51:02 +08:00
    php
    kingwkb
        39
    kingwkb  
       2013-03-17 21:58:54 +08:00
    之前用python,现在换到ruby

    http://s.yanghao.org/
    gameending
        40
    gameending  
       2013-03-17 22:09:33 +08:00
    python跟java都写过,python很简洁,java的话我觉得也还不错
    lbj96347
        41
    lbj96347  
       2013-03-17 23:08:21 +08:00
    node.js or python. :-)
    kdepp
        42
    kdepp  
       2013-07-07 23:03:59 +08:00
    node + cheerio
    briefcopy
        43
    briefcopy  
       2014-08-18 21:22:21 +08:00
    cangbaotu
        44
    cangbaotu  
       2016-05-24 17:12:36 +08:00
    http://www.shenjianshou.cn/ 神箭手云爬虫
    ssllff123
        45
    ssllff123  
       2016-10-10 14:56:50 +08:00
    @for4 我和你想的一样,但是有些问题
    1 ,是不是 celery 就可以自动多线程了。任务只需要实现爬虫的功能就可以了。
    2 ,感觉并不快啊 。
    3 ,可否有写好的项目看看
    billyellow
        46
    billyellow  
       2016-11-16 18:48:53 +08:00   ❤️ 1
    推荐试下这个 http://www.zaoshu.io
    GrahamCloud
        47
    GrahamCloud  
       2017-02-23 14:11:42 +08:00
    @billyellow 好的!
    jiankaikey
        48
    jiankaikey  
       2018-11-30 18:50:29 +08:00
    右键->另存为
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2963 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 00:32 · PVG 08:32 · LAX 17:32 · JFK 20:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.