Simple Signal Handling in Scrapy/Python giving error -
i'm trying catch closed
signal in scrapy following code.
and error
traceback (most recent call last): signal.signal(scrapy.signals.spider_closed,scrapy_clean_up) typeerror: integer required
this code
import scrapy import signal,os def scrapy_clean_up(): print "scrapy has closed!" signal.signal(scrapy.signals.spider_closed,scrapy_clean_up)
am missing something?
the usual approach have scrapy signal handler use dispatcher
:
from scrapy.xlib.pydispatch import dispatcher dispatcher.connect(scrapy_clean_up, signal=scrapy.signals.spider_closed)
Comments
Post a Comment