2016-06-22 64 views
0

當我使用scrapy-redis時,它將設置蜘蛛DontCloseSpider。 如何知道scrapy爬行完成。如何知道scrapy-redis finsh

crawler.signals.connect(ext.spider_closed,信號= signals.spider_closed)不工作

回答

1

有趣。

我看到此評論:

# Max idle time to prevent the spider from being closed when distributed crawling. 
# This only works if queue class is SpiderQueue or SpiderStack, 
# and may also block the same time when your spider start at the first time (because the queue is empty). 
SCHEDULER_IDLE_BEFORE_CLOSE = 10 

如果按照安裝說明正確,它不工作,我想,至少你將不得不給一些數據,允許例如複製您的設置你的settings.py或者你有任何有趣的蜘蛛/管道。

spider_closed確實應該發生信號。僅在隊列中的URL用完幾秒之後。如果隊列不空,蜘蛛就不會關閉 - 顯然。