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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -