推荐学习书目
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 · 5910 views
    This topic created in 3718 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
        1
    sunchen  
       Mar 7, 2016
    入职笔试写爬虫,一猜就是创宇。
    wenyu1001
        2
    wenyu1001  
    OP
       Mar 8, 2016
    @sunchen 不用猜 :)

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

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