Skip to content

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

Document spider.state attribute (#5174)

kamran890e5998fb8469d
diff --git a/docs/topics/jobs.rst b/docs/topics/jobs.rst
index e49f37a2f..f16d306c7 100644
--- a/docs/topics/jobs.rst
+++ b/docs/topics/jobs.rst
@@ -39,6 +39,8 @@ a signal), and resume it later by issuing the same command::
scrapy crawl somespider -s JOBDIR=crawls/somespider-1
+.. _topics-keeping-persistent-state-between-batches:
+
Keeping persistent state between batches
========================================
diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst
index 67b9e2e0e..4d3d32941 100644
--- a/docs/topics/spiders.rst
+++ b/docs/topics/spiders.rst
@@ -122,6 +122,11 @@ scrapy.Spider
send log messages through it as described on
:ref:`topics-logging-from-spiders`.
+ .. attribute:: state
+
+ A dict you can use to persist some spider state between batches.
+ See :ref:`topics-keeping-persistent-state-between-batches` to know more about it.
+
.. method:: from_crawler(crawler, *args, **kwargs)
This is the class method used by Scrapy to create your spiders.