推荐学习书目
› 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
wenyu1001
V2EX  ›  Python

如何优化一个爬虫,提升两个档次?

  •  
  •   wenyu1001 ·
    wenyuace · Mar 7, 2016 · 6315 views
    This topic created in 3907 days ago, the information mentioned may be changed or developed.

    入职笔试时基于 python 撸了个爬虫,闲来无事准备去改改。

    那么问题来了,如何优化去提升两个档次?

    • framework
    • performance
    • code style
    • ...

    https://github.com/wenyu1001/spider.git

    12 replies  •  2016-03-09 13:26:30 +08:00
    sunchen
    sunchen
    Mar 7, 2016
    1
    入职笔试写爬虫,一猜就是创宇。
    wenyu1001
    wenyu1001
    OP
    Mar 8, 2016
    2
    @sunchen 不用猜 :)

    是否先从稳定性,准确性入手优化?
    helloworldwt
    helloworldwt
    Mar 8, 2016
    3
    爬虫需要使用代理,这样你 ip 被封时,减少对程序的影响
    flamhaze5946
    flamhaze5946
    Mar 8, 2016 via Android
    4
    好吧。。是爬美女网站吗。。。当初被拒了(ฅ>ω<*ฅ)
    wenyu1001
    wenyu1001
    OP
    Mar 8, 2016
    5
    @helloworldwt
    是,可以加入 httpproxy, socks 代理

    @flamhaze5946
    想法真丰富
    CrazySpiderMan
    CrazySpiderMan
    Mar 8, 2016
    6
    是我的话, 我直接换 Node.js 了. Python 搞爬虫, 麻烦的很.
    CrazySpiderMan
    CrazySpiderMan
    Mar 8, 2016
    7
    @CrazySpiderMan 这里有个我用 Node.js 写个 P2P 网络的爬虫. https://github.com/Fuck-You-GFW/p2pspider
    l6751902
    l6751902
    Mar 8, 2016
    8
    黑 V2EX 后台,上传爬虫远程管理工具,然后把爬虫实际执行的逻辑嵌入前端.........
    sampeng
    sampeng
    Mar 8, 2016
    9
    加 2 倍机器。。绝对提升两个档次
    wenyu1001
    wenyu1001
    OP
    Mar 8, 2016
    10
    @sampeng nice!
    penjianfeng
    penjianfeng
    Mar 8, 2016
    11
    这还不简单,先把性能降 2 倍,然后在切换回来,绝对提升两个档次,哈哈哈
    wenyu1001
    wenyu1001
    OP
    Mar 9, 2016
    12
    @penjianfeng
    这要是被领导知道,还不等着去财务处领工资?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   982 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 19:38 · PVG 03:38 · LAX 11:38 · JFK 14:38
    ♥ Do have faith in what you're doing.