I see this question, and I see this question, but the official Scrapy page on pipelines mention nothing about signals.
This is the code I have so far:
import sqlite3
import datetime
from scrapy import signals
from scrapy.xlib.pydispatch import dispatcher
from scrapy import log
class Sqlite3StorePipeline(object):
def __init__(self):
print 'wtf'
dispatcher.connect(self.open_spider, signals.spider_opened)
dispatcher.connect(self.close_spider, signals.spider_closed)
def open_spider(self, spider):
print 'wtf2'
...
When I run my spider using the command scrapy crawl <spider name>
, I only see "wtf" but not "wtf2" being output.
How can I get my open_spider
function to be called?