Skip to content

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

Docs improvements.

Andrey Rakhmatullin61ef37a59447
diff --git a/docs/topics/settings.rst b/docs/topics/settings.rst
index d3fe6bbe2..3006fb8b1 100644
--- a/docs/topics/settings.rst
+++ b/docs/topics/settings.rst
@@ -115,8 +115,10 @@ arguments <spiderargs>` or other logic:
@classmethod
def from_crawler(cls, crawler, *args, **kwargs):
spider = super().from_crawler(crawler, *args, **kwargs)
- if "value" in kwargs:
- spider.settings.set("SOME_SETTING", kwargs["value"], priority="spider")
+ if "some_argument" in kwargs:
+ spider.settings.set(
+ "SOME_SETTING", kwargs["some_argument"], priority="spider"
+ )
return spider
3. Project settings module
diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst
index d9cbbe35a..3197daf65 100644
--- a/docs/topics/spiders.rst
+++ b/docs/topics/spiders.rst
@@ -138,10 +138,11 @@ scrapy.Spider
.. versionchanged:: VERSION
- The settings in ``crawler.settings`` can now be modified, which is
- handy if you want to modify them based on arguments. As a
- consequence, these settings aren't the final values as they can be
- modified later by e.g. :ref:`add-ons <topics-addons>`.
+ The settings in ``crawler.settings`` can now be modified in this
+ method, which is handy if you want to modify them based on
+ arguments. As a consequence, these settings aren't the final values
+ as they can be modified later by e.g. :ref:`add-ons
+ <topics-addons>`. The settings become final when the spider starts.
:param crawler: crawler to which the spider will be bound
:type crawler: :class:`~scrapy.crawler.Crawler` instance