Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Update practices.rst

irgmedeirosd9e0fdc9aa35
diff --git a/docs/topics/practices.rst b/docs/topics/practices.rst
index 444596313..23ae042a7 100644
--- a/docs/topics/practices.rst
+++ b/docs/topics/practices.rst
@@ -29,12 +29,13 @@ project as example.
from twisted.internet import reactor
from scrapy.crawler import Crawler
- from scrapy.settings import Settings
from scrapy import log, signals
from testspiders.spiders.followall import FollowAllSpider
+ from scrapy.utils.project import get_project_settings
spider = FollowAllSpider(domain='scrapinghub.com')
- crawler = Crawler(Settings())
+ settings = get_project_settings()
+ crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)