Scrapy, a fast high-level web crawling & scraping framework for Python.
use crawler only to register signals in from_crawler()
muriloviana09c401bf8e13
diff --git a/scrapy/templates/project/module/middlewares.py.tmpl b/scrapy/templates/project/module/middlewares.py.tmplindex 8b9827527..42318fec2 100644--- a/scrapy/templates/project/module/middlewares.py.tmpl+++ b/scrapy/templates/project/module/middlewares.py.tmpl@@ -16,7 +16,7 @@ class ${ProjectName}SpiderMiddleware(object):@classmethoddef 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