Running Scrapy tasks in Python

前端 未结 4 1060
礼貌的吻别
礼貌的吻别 2020-12-13 16:20

My Scrapy script seems to work just fine when I run it in \'one off\' scenarios from the command line, but if I try running the code twice in the same python session I get t

4条回答
  •  一生所求
    2020-12-13 16:56

    crawler.start() starts Twisted reactor. There can be only one reactor.

    If you want to run more spiders - use

    another_spider = MyAnotherSpider()
    crawler.queue.append_spider(another_spider)
    

提交回复
热议问题