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:
parent
32fd692810
commit
09c401bf8e
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user