推荐学习书目
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 · 5633 views
    This topic created in 3571 days ago, the information mentioned may be changed or developed.

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

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

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

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

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