推荐学习书目
› 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 · 2823 views
    This topic created in 2612 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   ·   Privacy   ·   Solana   ·   4867 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 05:56 · PVG 13:56 · LAX 22:56 · JFK 01:56
    ♥ Do have faith in what you're doing.