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
Jessss
V2EX  ›  Python

为什么 scrapy 爬虫没有一次性爬完 Rule 所需要的所有数据呢?

  •  
  •   Jessss · 2017-05-18 11:37:35 +08:00 · 2544 次点击
    这是一个创建于 2536 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我用 scrapy 和代理池爬拉勾网,中间没有报错,但是每次运行代码都只是爬一两万条数据就结束,下次运行又有新的数据,为什么不会一次性爬完所有数据呢?

    望大神们指点,谢谢!

    6 条回复    2017-05-21 16:43:25 +08:00
    littleylv
        1
    littleylv  
       2017-05-18 11:43:55 +08:00
    是不是限制了深度了呢?
    Jessss
        2
    Jessss  
    OP
       2017-05-18 11:50:49 +08:00
    @littleylv 没有设置深度或者广度之类的
    dsg001
        3
    dsg001  
       2017-05-18 14:35:19 +08:00
    深层的模板有变化导致规则抓取不到,检查下最终页的模板是否匹配规则
    Jessss
        4
    Jessss  
    OP
       2017-05-19 14:04:58 +08:00
    @dsg001 其他页面也符合匹配规则的。中间尝试修改了 rule,多试几次居然被禁了,现在感觉是我的代理中间件有问题,好像没用到
    dsg001
        5
    dsg001  
       2017-05-19 18:25:27 +08:00
    @Jessss 返回脏数据吗?只能加日志,一步步调试检查
    Jessss
        6
    Jessss  
    OP
       2017-05-21 16:43:25 +08:00
    @dsg001 数据是正常的,我试试加日志看看先
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3432 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 00:51 · PVG 08:51 · LAX 17:51 · JFK 20:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.