首先设置一个循环,接着为每一个爬虫设置一个定时器,让每一个爬虫爬虫一段时间,再运行下一个爬虫即可。具体代码如下,此处设置每一个爬虫运行3600秒

import os

while True:
    os.system("scrapy crawl xinhuanet -s CLOSESPIDER_TIMEOUT=3600")  # 新华网
    os.system("scrapy crawl money163 -s CLOSESPIDER_TIMEOUT=3600")  # 网易财经
    os.system("scrapy crawl ccstock -s CLOSESPIDER_TIMEOUT=3600")  # 证券日报
    os.system("scrapy crawl cs -s CLOSESPIDER_TIMEOUT=3600")  # 中证网
    os.system("scrapy crawl p5w -s CLOSESPIDER_TIMEOUT=3600")  # 全景网
    os.system("scrapy crawl ztcj -s CLOSESPIDER_TIMEOUT=3600")  # 智通财经
    os.system("scrapy crawl huanqiu_finance -s CLOSESPIDER_TIMEOUT=3600")  # 环球财经

  

相关文章:

  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-01-06
  • 2021-12-06
猜你喜欢
  • 2021-08-15
  • 2021-11-27
  • 2021-12-09
  • 2021-08-30
  • 2021-11-30
  • 2021-08-22
  • 2022-12-23
相关资源
相似解决方案