2016-06-22 65 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用完几秒之后。如果队列不空,蜘蛛就不会关闭 - 显然。