2016-06-22 3 views
0

scrapy-redis를 사용하면 spider DontCloseSpider가 설정됩니다. 치료 크롤링 완료 방법.scrap-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이 부족한 지 꽤 오래되었습니다. 대기열이 비어 있지 않으면 스파이더가 닫히지 않습니다.