V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
hujianxin
V2EX  ›  Python

scrapy 爬取代理,检查代理的程序放在 pipelines 里面合适吗?

  •  
  •   hujianxin · 2016-10-03 14:34:51 +08:00 · 2135 次点击
    这是一个创建于 2768 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用 scrapy 爬取代理,如果想检查代理可用性的话,使用单独的程序检查合适呢,还是放在 pipelines 里面检查合适呢?

    我是想通过并发的检查代理。

    4 条回复    2016-10-03 19:22:00 +08:00
    scnace
        1
    scnace  
       2016-10-03 14:58:47 +08:00 via Android
    我的 proxypool 放在了 pipeline 里检查 考虑到免费代理的生命周期和稳定性 其实抓取代理并维护一个代理的数据结构 开一个协程定期 selfcheck 我觉得更合适点。。。
    hujianxin
        2
    hujianxin  
    OP
       2016-10-03 16:01:02 +08:00
    @scnace 谢谢回复,我也觉得另起一个程序检查好,因为第一遍检查完了,它还是会过期的。另外请教一下,这个代理池使用一个表存储好呢还是使用两个表(一个存储没检查的,一个存储可用的)。这两种那一种方便呢?
    scnace
        3
    scnace  
       2016-10-03 18:43:31 +08:00 via Android
    @hujianxin 我用了一个 k v 表存(即所谓的“池”
    dsg001
        4
    dsg001  
       2016-10-03 19:22:00 +08:00
    过期代理也不能完全抛弃,有些还会复活的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2156 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 02:09 · PVG 10:09 · LAX 19:09 · JFK 22:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.