推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
creaer
V2EX  ›  Python

Python 反爬虫

  •  
  •   creaer · Aug 29, 2016 · 6209 views
    This topic created in 3718 days ago, the information mentioned may be changed or developed.

    今天爬知乎被封了,请问如何绕过反爬虫

    21 replies  •  2016-08-31 10:21:21 +08:00
    UnisandK
    UnisandK
    Aug 29, 2016
    1
    换 IP
    creaer
    creaer
    OP
    Aug 29, 2016
    2
    VicYu
    VicYu
    Aug 29, 2016
    3
    proxy list
    creaer
    creaer
    OP
    Aug 29, 2016
    4
    @VicYu 谢谢,感觉设置一个 sleep 好像也可以,暂时就这样吧
    dsg001
    dsg001
    Aug 29, 2016
    5
    单机几百线程爬知乎,爬 20+小时没问题,过了几天才被封
    airqj
    airqj
    Aug 29, 2016
    6
    @dsg001 我的也是
    感觉知乎的爬虫太迟钝了吧 :)
    582033
    582033
    Aug 29, 2016
    7
    https://gist.github.com/582033/19a35dac89d86b98e413567cc5fb2505

    自动多线程从指定网站获取代理列表
    creaer
    creaer
    OP
    Aug 29, 2016 via Android
    8
    @dsg001 我也是昨天开始爬,今天被封的
    masterzh01
    masterzh01
    Aug 29, 2016
    9
    hippoboy
    hippoboy
    Aug 29, 2016
    10
    好几台服务器装 Squid,自己做代理....
    creaer
    creaer
    OP
    Aug 29, 2016
    11
    creaer
    creaer
    OP
    Aug 29, 2016
    12
    @hippoboy 这个成本不低 我就自己玩玩
    Allianzcortex
    Allianzcortex
    Aug 29, 2016❤️1
    13
    换 UA ,换 IP ,多线程,设置等待时间。

    我曾经有段时间买了个国外服务器安装 SS,然后连接上后走 Socks5 代理。被封的次数就很少。
    creaer
    creaer
    OP
    Aug 29, 2016 via Android
    14
    @Allianzcortex 设置等待时间好像没啥用,而且速度反而降低了
    Allianzcortex
    Allianzcortex
    Aug 29, 2016
    15
    @creaer 服务器要区分人和机器行为的重要依据就是访问频率啊,增加等待时间会更容易混淆服务器。设置等待时间也比较友好:-D
    7sDream
    7sDream
    Aug 29, 2016
    16
    可以尝试用知乎的 RESTful OAuth API ,比起访问网页版好像比较不容易被封。

    具体资料我就不贴了。
    dsg001
    dsg001
    Aug 30, 2016❤️1
    17
    @creaer
    @airqj
    所以尽量提高单位时间的爬取速度,被封后换 IP 继续
    airqj
    airqj
    Aug 30, 2016 via Android
    18
    @dsg001 目前已经爬得差不多了
    而且免费的代理不靠谱 就不折腾了
    creaer
    creaer
    OP
    Aug 30, 2016 via Android
    19
    @Allianzcortex 难道是因为我设置的等待时间太短了
    Allianzcortex
    Allianzcortex
    Aug 30, 2016
    20
    @creaer https://segmentfault.com/a/1190000005840672 你可以看看这篇文章,看看携程反爬虫的思路。反爬虫最重要的是不能影响业务,不能使正常用户的访问受影响~
    ijustdo
    ijustdo
    Aug 31, 2016
    21
    user agent 不停的换 最好比喻 ios android 。。。。。。
    还有个大招 挂代理 控制爬去速度。。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3071 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 11:15 · PVG 19:15 · LAX 03:15 · JFK 06:15
    ♥ Do have faith in what you're doing.