1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-23 23:03:42 +00:00

use crawler only to register signals in from_crawler()

This commit is contained in:
muriloviana 2016-10-19 14:09:01 -02:00
parent 32fd692810
commit 09c401bf8e

View File

@ -16,7 +16,7 @@ class ${ProjectName}SpiderMiddleware(object):
@classmethod
def from_crawler(cls, crawler):
# This method is used by Scrapy to create your spiders.
s = cls(crawler.stats)
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s