Scrapy, a fast high-level web crawling & scraping framework for Python.
Document scrapy.crawler.Crawler.stop()
Adrián Chavesd7795484dcad
diff --git a/docs/topics/api.rst b/docs/topics/api.rstindex e1623287d..7c8c40b5f 100644--- a/docs/topics/api.rst+++ b/docs/topics/api.rst@@ -99,6 +99,8 @@ how you :ref:`configure the downloader middlewaresReturns a deferred that is fired when the crawl is finished.+ .. automethod:: stop+.. autoclass:: CrawlerRunner:members:diff --git a/scrapy/crawler.py b/scrapy/crawler.pyindex 99bf48385..151ae4f62 100644--- a/scrapy/crawler.py+++ b/scrapy/crawler.py@@ -111,6 +111,8 @@ class Crawler(object):@defer.inlineCallbacksdef stop(self):+ """Starts a graceful stop of the crawler and returns a deferred that is+ fired when the crawler is stopped."""if self.crawling:self.crawling = Falseyield defer.maybeDeferred(self.engine.stop)