V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
zpwsmile
V2EX  ›  Python

请问如何在 scrapy 中使用非阻塞暂停

  •  
  •   zpwsmile · Aug 5, 2019 · 2499 views
    This topic created in 2471 days ago, the information mentioned may be changed or developed.
    scrapy 中,如何使用非阻塞暂停?
    比如:
    有函数 parse(...)
    然后自己编写的 parse1(...)、parse2(...)。。。
    在 parse1(...) 的函数体中,想要有暂停操作,我用的 time.sleep 后发现整个程序全局都暂停了,
    请问如何在 scrapy 中使用非阻塞暂停
    AlloVince
        1
    AlloVince  
       Aug 5, 2019
    未验证,可以尝试 yield asyncio.sleep(5)
    zpwsmile
        2
    zpwsmile  
    OP
       Aug 5, 2019
    @AlloVince 好的,我验证下,谢谢~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4920 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 262ms · UTC 09:53 · PVG 17:53 · LAX 02:53 · JFK 05:53
    ♥ Do have faith in what you're doing.