Scrapy, a fast high-level web crawling & scraping framework for Python.
Remove Sphinx module synopsis attributes and make a smarter use of module/currentmodule to minimize typing (#8011)
Adrian99323bde7592
diff --git a/docs/topics/api.rst b/docs/topics/api.rstindex 2d6005068..5d78e7bd4 100644--- a/docs/topics/api.rst+++ b/docs/topics/api.rst@@ -19,7 +19,6 @@ components, and it is the only way for components to access them and hook theirfunctionality into Scrapy... module:: scrapy.crawler- :synopsis: The Scrapy crawlerThe Extension Manager is responsible for loading and keeping track of installedextensions and it's configured through the :setting:`EXTENSIONS` setting which@@ -138,7 +137,6 @@ Settings API============.. module:: scrapy.settings- :synopsis: Settings manager.. attribute:: SETTINGS_PRIORITIES@@ -181,7 +179,6 @@ SpiderLoader API================.. module:: scrapy.spiderloader- :synopsis: The spider loaderCustom spider loaders can be employed by specifying their path in the:setting:`SPIDER_LOADER_CLASS` project setting. They must implement@@ -201,7 +198,6 @@ Signals API===========.. automodule:: scrapy.signalmanager- :synopsis: The signal manager:members::undoc-members:@@ -216,7 +212,6 @@ Collector API defined by the :class:`~scrapy.statscollectors.StatsCollector`class (which they all inherit from)... module:: scrapy.statscollectors- :synopsis: Stats Collectors.. class:: StatsCollectordiff --git a/docs/topics/contracts.rst b/docs/topics/contracts.rstindex 59b8855ea..6678dcddc 100644--- a/docs/topics/contracts.rst+++ b/docs/topics/contracts.rst@@ -77,9 +77,7 @@ create and load your own contracts in the project by using theEach contract must inherit from :class:`~scrapy.contracts.Contract` and canoverride three methods:-.. module:: scrapy.contracts--.. autoclass:: Contract+.. autoclass:: scrapy.contracts.Contract.. automethod:: adjust_request_argsdiff --git a/docs/topics/cookies.rst b/docs/topics/cookies.rstindex ab5f3dca0..d7fcf6eca 100644--- a/docs/topics/cookies.rst+++ b/docs/topics/cookies.rst@@ -132,7 +132,4 @@ header)::CookiesMiddleware=================-.. module:: scrapy.downloadermiddlewares.cookies- :synopsis: Cookies Downloader Middleware--.. autoclass:: CookiesMiddleware+.. autoclass:: scrapy.downloadermiddlewares.cookies.CookiesMiddlewarediff --git a/docs/topics/downloader-middleware.rst b/docs/topics/downloader-middleware.rstindex ae35d5e9b..8fcad6239 100644--- a/docs/topics/downloader-middleware.rst+++ b/docs/topics/downloader-middleware.rst@@ -1,3 +1,5 @@+.. module:: scrapy.downloadermiddlewares+.. _topics-downloader-middleware:=====================@@ -30,11 +32,11 @@ The :setting:`DOWNLOADER_MIDDLEWARES` setting is merged with the:setting:`DOWNLOADER_MIDDLEWARES_BASE` setting defined in Scrapy (and not meantto be overridden) and then sorted by order to get the final sorted list ofenabled middlewares: the first middleware is the one closer to the engine and-the last is the one closer to the downloader. In other words,-the :meth:`~scrapy.downloadermiddlewares.DownloaderMiddleware.process_request`-method of each middleware will be invoked in increasing-middleware order (100, 200, 300, ...) and the :meth:`~scrapy.downloadermiddlewares.DownloaderMiddleware.process_response` method-of each middleware will be invoked in decreasing order.+the last is the one closer to the downloader. In other words, the+:meth:`~DownloaderMiddleware.process_request` method of each middleware will be+invoked in increasing middleware order (100, 200, 300, ...) and the+:meth:`~DownloaderMiddleware.process_response` method of each middleware will+be invoked in decreasing order.To decide which order to assign to your middleware see the:setting:`DOWNLOADER_MIDDLEWARES_BASE` setting and pick a value according to@@ -65,8 +67,6 @@ Writing your own downloader middlewareEach downloader middleware is a :ref:`component <topics-components>` thatdefines one or more of these methods:-.. module:: scrapy.downloadermiddlewares-.. class:: DownloaderMiddleware.. note:: Any of the downloader middleware methods may be defined as a@@ -157,6 +157,8 @@ defines one or more of these methods::param exception: the raised exception:type exception: an ``Exception`` object+.. currentmodule:: None+.. _mw-download:Downloading a request from a downloader middleware@@ -234,10 +236,7 @@ See :ref:`cookies`.DefaultHeadersMiddleware-------------------------.. module:: scrapy.downloadermiddlewares.defaultheaders- :synopsis: Default Headers Downloader Middleware--.. class:: DefaultHeadersMiddleware+.. class:: scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddlewareThis middleware sets all default requests headers specified in the:setting:`DEFAULT_REQUEST_HEADERS` setting.@@ -245,10 +244,7 @@ DefaultHeadersMiddlewareDownloadTimeoutMiddleware--------------------------.. module:: scrapy.downloadermiddlewares.downloadtimeout- :synopsis: Download timeout middleware--.. class:: DownloadTimeoutMiddleware+.. class:: scrapy.downloadermiddlewares.downloadtimeout.DownloadTimeoutMiddlewareThis middleware sets the download timeout for requests specified in the:setting:`DOWNLOAD_TIMEOUT` setting.@@ -262,10 +258,7 @@ DownloadTimeoutMiddlewareHttpAuthMiddleware-------------------.. module:: scrapy.downloadermiddlewares.httpauth- :synopsis: HTTP Auth downloader middleware--.. class:: HttpAuthMiddleware+.. class:: scrapy.downloadermiddlewares.httpauth.HttpAuthMiddlewareThis middleware authenticates requests using `Basic access authentication`_(aka. HTTP auth).@@ -353,10 +346,7 @@ or :setting:`HTTPAUTH_PASS` is set.HttpCacheMiddleware--------------------.. module:: scrapy.downloadermiddlewares.httpcache- :synopsis: HTTP Cache downloader middleware--.. class:: HttpCacheMiddleware+.. class:: scrapy.downloadermiddlewares.httpcache.HttpCacheMiddlewareThis middleware provides low-level cache to all HTTP requests and responses.It has to be combined with a cache storage backend as well as a cache policy.@@ -391,7 +381,6 @@ HttpCacheMiddlewarethe page was downloaded rather than to the current time... module:: scrapy.extensions.httpcache- :noindex:.. _httpcache-policy-dummy:@@ -517,8 +506,6 @@ To store a response, use :meth:`Response.to_dict():func:`~scrapy.utils.response.response_from_dict`. That way responses of anyclass, including those of third-party plugins, are cached and restored intact.-.. module:: scrapy.extensions.httpcache-.. class:: CacheStorage.. method:: open_spider(spider)@@ -712,15 +699,14 @@ We assume that the spider will not issue Cache-Control directivesin requests unless it actually needs them, so directives in requests arenot filtered.+.. currentmodule:: None+.. _http-compression:HttpCompressionMiddleware--------------------------.. module:: scrapy.downloadermiddlewares.httpcompression- :synopsis: Http Compression Middleware--.. class:: HttpCompressionMiddleware+.. class:: scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddlewareThis middleware allows compressed (gzip, deflate, `brotli`_, `zstd`_)traffic to be sent/received from web sites.@@ -745,11 +731,10 @@ Whether the Compression middleware will be enabled.HttpProxyMiddleware--------------------.. module:: scrapy.downloadermiddlewares.httpproxy- :synopsis: Http Proxy Middleware-.. reqmeta:: proxy+.. module:: scrapy.downloadermiddlewares.httpproxy+.. class:: HttpProxyMiddlewareThis middleware sets the HTTP proxy to use for requests, by setting the@@ -815,10 +800,7 @@ The default encoding for proxy authentication on :class:`HttpProxyMiddleware`.OffsiteMiddleware------------------.. module:: scrapy.downloadermiddlewares.offsite- :synopsis: Offsite Middleware--.. autoclass:: OffsiteMiddleware+.. autoclass:: scrapy.downloadermiddlewares.offsite.OffsiteMiddleware.. automethod:: should_follow@@ -826,7 +808,6 @@ RedirectMiddleware------------------.. module:: scrapy.downloadermiddlewares.redirect- :synopsis: Redirection Middleware.. class:: RedirectMiddleware@@ -1006,7 +987,6 @@ RetryMiddleware---------------.. module:: scrapy.downloadermiddlewares.retry- :synopsis: Retry Middleware.. class:: RetryMiddleware@@ -1137,15 +1117,14 @@ Adjust retry request priority relative to original request:See also: :reqmeta:`priority_adjust`.+.. currentmodule:: None+.. _topics-dlmw-robots:RobotsTxtMiddleware--------------------.. module:: scrapy.downloadermiddlewares.robotstxt- :synopsis: robots.txt middleware--.. class:: RobotsTxtMiddleware+.. class:: scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddlewareThis middleware filters out requests forbidden by the robots.txt exclusionstandard.@@ -1265,10 +1244,7 @@ You can implement support for a new robots.txt_ parser by subclassingthe abstract base class :class:`~scrapy.robotstxt.RobotParser` andimplementing the methods described below.-.. module:: scrapy.robotstxt- :synopsis: robots.txt parser interface and implementations--.. autoclass:: RobotParser+.. autoclass:: scrapy.robotstxt.RobotParser:members:.. _robots.txt: https://www.robotstxt.org/@@ -1276,10 +1252,7 @@ implementing the methods described below.DownloaderStats----------------.. module:: scrapy.downloadermiddlewares.stats- :synopsis: Downloader Stats Middleware--.. class:: DownloaderStats+.. class:: scrapy.downloadermiddlewares.stats.DownloaderStatsMiddleware that stores stats of all requests, responses and exceptions thatpass through it.@@ -1290,10 +1263,7 @@ DownloaderStatsUserAgentMiddleware--------------------.. module:: scrapy.downloadermiddlewares.useragent- :synopsis: User Agent Middleware--.. class:: UserAgentMiddleware+.. class:: scrapy.downloadermiddlewares.useragent.UserAgentMiddlewareMiddleware that sets the ``User-Agent`` header.diff --git a/docs/topics/exporters.rst b/docs/topics/exporters.rstindex d7bc5675e..ee906d002 100644--- a/docs/topics/exporters.rst+++ b/docs/topics/exporters.rst@@ -5,7 +5,6 @@ Item Exporters==============.. module:: scrapy.exporters- :synopsis: Item ExportersOnce you have scraped your items, you often want to persist or export thoseitems, to use the data in some other application. That is, after all, the wholediff --git a/docs/topics/extensions.rst b/docs/topics/extensions.rstindex ee3b26aa1..440377e56 100644--- a/docs/topics/extensions.rst+++ b/docs/topics/extensions.rst@@ -119,20 +119,14 @@ General purpose extensionsLog Stats extension~~~~~~~~~~~~~~~~~~~-.. module:: scrapy.extensions.logstats- :synopsis: Basic stats logging--.. class:: LogStats+.. class:: scrapy.extensions.logstats.LogStatsLog basic stats like crawled pages and scraped items.Core Stats extension~~~~~~~~~~~~~~~~~~~~-.. module:: scrapy.extensions.corestats- :synopsis: Core stats collection--.. class:: CoreStats+.. class:: scrapy.extensions.corestats.CoreStatsEnable the collection of core statistics, provided the stats collection isenabled (see :ref:`topics-stats`).@@ -145,20 +139,14 @@ The following stats are collected: :stat:`elapsed_time_seconds`,Log Count extension~~~~~~~~~~~~~~~~~~~-.. module:: scrapy.extensions.logcount- :synopsis: Basic stats logging--.. autoclass:: LogCount+.. autoclass:: scrapy.extensions.logcount.LogCount.. _topics-extensions-ref-memusage:Memory usage extension~~~~~~~~~~~~~~~~~~~~~~-.. module:: scrapy.extensions.memusage- :synopsis: Memory usage extension--.. class:: MemoryUsage+.. class:: scrapy.extensions.memusage.MemoryUsage.. note:: This extension does not work in Windows.@@ -179,10 +167,7 @@ can be configured with the following settings:Memory debugger extension~~~~~~~~~~~~~~~~~~~~~~~~~-.. module:: scrapy.extensions.memdebug- :synopsis: Memory debugger extension--.. class:: MemoryDebugger+.. class:: scrapy.extensions.memdebug.MemoryDebuggerAn extension for debugging memory usage. It collects information about:@@ -198,10 +183,7 @@ info will be stored in the :stat:`memdebug/gc_garbage_count` andSpider state extension~~~~~~~~~~~~~~~~~~~~~~-.. module:: scrapy.extensions.spiderstate- :synopsis: Spider state extension--.. class:: SpiderState+.. class:: scrapy.extensions.spiderstate.SpiderStateManages spider state data by loading it before a crawl and saving it after.@@ -222,10 +204,7 @@ For an example, see :ref:`topics-keeping-persistent-state-between-batches`.Close spider extension~~~~~~~~~~~~~~~~~~~~~~-.. module:: scrapy.extensions.closespider- :synopsis: Close spider extension--.. class:: CloseSpider+.. class:: scrapy.extensions.closespider.CloseSpiderCloses a spider automatically when some conditions are met, using a specificclosing reason for each condition.@@ -318,13 +297,10 @@ closing the spider. If the spider generates more than that number of errors,it will be closed with the reason ``closespider_errorcount``. If zero (or nonset), spiders won't be closed by number of errors.-.. module:: scrapy.extensions.periodic_log- :synopsis: Periodic stats logging-Periodic log extension~~~~~~~~~~~~~~~~~~~~~~-.. class:: PeriodicLog+.. class:: scrapy.extensions.periodic_log.PeriodicLogThis extension periodically logs rich stat data as a JSON object::@@ -437,12 +413,11 @@ Default: ``False``Debugging extensions---------------------.. module:: scrapy.extensions.debug- :synopsis: Extensions for debugging Scrapy-Stack trace dump extension~~~~~~~~~~~~~~~~~~~~~~~~~~+.. module:: scrapy.extensions.debug+.. class:: StackTraceDumpDumps information about the running process when a `SIGQUIT`_ or `SIGUSR2`_@@ -480,15 +455,14 @@ running normally.This extension only works on POSIX-compliant platforms (i.e. not Windows).+.. currentmodule:: None+.. _topics-extensions-ref-telnetconsole:Telnet console extension~~~~~~~~~~~~~~~~~~~~~~~~-.. module:: scrapy.extensions.telnet- :synopsis: Telnet console--.. class:: TelnetConsole+.. class:: scrapy.extensions.telnet.TelnetConsoleProvides a telnet console for getting into a Python interpreter inside thecurrently running Scrapy process, which can be very useful for debugging.diff --git a/docs/topics/feed-exports.rst b/docs/topics/feed-exports.rstindex 7d8a02f8e..4ce874249 100644--- a/docs/topics/feed-exports.rst+++ b/docs/topics/feed-exports.rst@@ -442,8 +442,6 @@ These are the settings used for configuring the feed exports:- :setting:`FEED_EXPORTERS`- :setting:`FEED_EXPORT_BATCH_ITEM_COUNT`-.. currentmodule:: scrapy.extensions.feedexport-.. setting:: FEEDSFEEDS@@ -768,7 +766,7 @@ feed URI.The function signature should be as follows:-.. function:: uri_params(params, spider)+.. function:: scrapy.extensions.feedexport.uri_params(params, spider)Return a :class:`dict` of key-value pairs to apply to the feed URI using:ref:`printf-style string formatting <python:old-string-formatting>`.diff --git a/docs/topics/items.rst b/docs/topics/items.rstindex 0892dd839..1bd7fa312 100644--- a/docs/topics/items.rst+++ b/docs/topics/items.rst@@ -5,7 +5,6 @@ Items=====.. module:: scrapy.item- :synopsis: Item and Field classesThe main goal in scraping is to extract structured data from unstructuredsources, typically, web pages. :ref:`Spiders <topics-spiders>` may return thediff --git a/docs/topics/leaks.rst b/docs/topics/leaks.rstindex a055ee715..ea60a14ce 100644--- a/docs/topics/leaks.rst+++ b/docs/topics/leaks.rst@@ -180,7 +180,6 @@ example, this won't show any live references to spiders:>>> prefs(ignore=Spider).. module:: scrapy.utils.trackref- :synopsis: Track references of live objectsscrapy.utils.trackref module----------------------------diff --git a/docs/topics/link-extractors.rst b/docs/topics/link-extractors.rstindex c1d872dd0..3c0800710 100644--- a/docs/topics/link-extractors.rst+++ b/docs/topics/link-extractors.rst@@ -31,9 +31,6 @@ variable in your spider, and use it from your spider callbacks:Link extractor reference========================-.. module:: scrapy.linkextractors- :synopsis: Link extractors classes-The link extractor class is:class:`scrapy.linkextractors.lxmlhtml.LxmlLinkExtractor`. For convenience itcan also be imported as ``scrapy.linkextractors.LinkExtractor``:@@ -45,18 +42,11 @@ can also be imported as ``scrapy.linkextractors.LinkExtractor``:LxmlLinkExtractor------------------.. module:: scrapy.linkextractors.lxmlhtml- :synopsis: lxml's HTMLParser-based link extractors---.. autoclass:: LxmlLinkExtractor+.. autoclass:: scrapy.linkextractors.lxmlhtml.LxmlLinkExtractor.. automethod:: extract_linksLink-----.. module:: scrapy.link- :synopsis: Link from link extractors--.. autoclass:: Link+.. autoclass:: scrapy.link.Linkdiff --git a/docs/topics/loaders.rst b/docs/topics/loaders.rstindex 314e2c1ae..c6271f438 100644--- a/docs/topics/loaders.rst+++ b/docs/topics/loaders.rst@@ -5,7 +5,6 @@ Item Loaders============.. module:: scrapy.loader- :synopsis: Item Loader classItem Loaders provide a convenient mechanism for populating scraped :ref:`items<topics-items>`. Even though items can be populated directly, Item Loaders provide adiff --git a/docs/topics/logging.rst b/docs/topics/logging.rstindex 8ac691840..8c09e15eb 100644--- a/docs/topics/logging.rst+++ b/docs/topics/logging.rst@@ -367,10 +367,7 @@ and hide it without affecting other loggers:scrapy.utils.log module=======================-.. module:: scrapy.utils.log- :synopsis: Logging utils--.. autofunction:: configure_logging+.. autofunction:: scrapy.utils.log.configure_logging``configure_logging`` is automatically called when using Scrapy commandsor :class:`~scrapy.crawler.CrawlerProcess`, but needs to be called explicitlydiff --git a/docs/topics/media-pipeline.rst b/docs/topics/media-pipeline.rstindex 43fedbadc..b9cdf64bd 100644--- a/docs/topics/media-pipeline.rst+++ b/docs/topics/media-pipeline.rst@@ -567,7 +567,6 @@ Extending the Media Pipelines=============================.. module:: scrapy.pipelines.files- :synopsis: Files PipelineSee here the methods that you can override in your custom Files Pipeline:@@ -716,7 +715,6 @@ See here the methods that you can override in your custom Files Pipeline:.. module:: scrapy.pipelines.images- :synopsis: Images PipelineSee here the methods that you can override in your custom Images Pipeline:diff --git a/docs/topics/request-response.rst b/docs/topics/request-response.rstindex d001c46b9..b587a290f 100644--- a/docs/topics/request-response.rst+++ b/docs/topics/request-response.rst@@ -5,7 +5,6 @@ Requests and Responses======================.. module:: scrapy.http- :synopsis: Request and Response classesScrapy uses :class:`~scrapy.Request` and :class:`Response` objects for crawling websites.diff --git a/docs/topics/selectors.rst b/docs/topics/selectors.rstindex 6d4954c2d..dd919013d 100644--- a/docs/topics/selectors.rst+++ b/docs/topics/selectors.rst@@ -1039,7 +1039,6 @@ Built-in Selectors reference============================.. module:: scrapy.selector- :synopsis: Selector classSelector objects----------------diff --git a/docs/topics/signals.rst b/docs/topics/signals.rstindex c73edbf05..2aa13edf6 100644--- a/docs/topics/signals.rst+++ b/docs/topics/signals.rst@@ -112,7 +112,6 @@ Built-in signals reference==========================.. module:: scrapy.signals- :synopsis: Signals definitionsHere's the list of Scrapy built-in signals and their meaning.diff --git a/docs/topics/spider-middleware.rst b/docs/topics/spider-middleware.rstindex cb5608ac6..2558d4031 100644--- a/docs/topics/spider-middleware.rst+++ b/docs/topics/spider-middleware.rst@@ -1,3 +1,5 @@+.. module:: scrapy.spidermiddlewares+.. _topics-spider-middleware:=================@@ -31,12 +33,11 @@ The :setting:`SPIDER_MIDDLEWARES` setting is merged with the:setting:`SPIDER_MIDDLEWARES_BASE` setting defined in Scrapy (and not meant tobe overridden) and then sorted by order to get the final sorted list of enabledmiddlewares: the first middleware is the one closer to the engine and the last-is the one closer to the spider. In other words,-the :meth:`~scrapy.spidermiddlewares.SpiderMiddleware.process_spider_input`-method of each middleware will be invoked in increasing-middleware order (100, 200, 300, ...), and the-:meth:`~scrapy.spidermiddlewares.SpiderMiddleware.process_spider_output` method-of each middleware will be invoked in decreasing order.+is the one closer to the spider. In other words, the+:meth:`~SpiderMiddleware.process_spider_input` method of each middleware will+be invoked in increasing middleware order (100, 200, 300, ...), and the+:meth:`~SpiderMiddleware.process_spider_output` method of each middleware will+be invoked in decreasing order.To decide which order to assign to your middleware see the:setting:`SPIDER_MIDDLEWARES_BASE` setting and pick a value according to where@@ -67,8 +68,6 @@ Writing your own spider middlewareEach spider middleware is a :ref:`component <topics-components>` that definesone or more of these methods:-.. module:: scrapy.spidermiddlewares-.. class:: SpiderMiddleware.. method:: process_start(start: AsyncIterator[Any], /) -> AsyncIterator[Any]@@ -204,15 +203,15 @@ For example:# ... do something with ryield r+.. currentmodule:: None+Base class for custom spider middlewares----------------------------------------Scrapy provides a base class for custom spider middlewares. It's not requiredto use it but it can help with simplifying middleware implementations.-.. module:: scrapy.spidermiddlewares.base--.. autoclass:: BaseSpiderMiddleware+.. autoclass:: scrapy.spidermiddlewares.base.BaseSpiderMiddleware:members:.. _topics-spider-middleware-ref:@@ -230,20 +229,14 @@ For a list of the components enabled by default (and their orders) see theDepthMiddleware----------------.. module:: scrapy.spidermiddlewares.depth- :synopsis: Depth Spider Middleware-.. reqmeta:: depth-.. autoclass:: DepthMiddleware+.. autoclass:: scrapy.spidermiddlewares.depth.DepthMiddlewareHttpErrorMiddleware--------------------.. module:: scrapy.spidermiddlewares.httperror- :synopsis: HTTP Error Spider Middleware--.. class:: HttpErrorMiddleware+.. class:: scrapy.spidermiddlewares.httperror.HttpErrorMiddlewareFilter out unsuccessful (erroneous) HTTP responses so that spiders don'thave to deal with them, which (most of the time) imposes an overhead,@@ -312,10 +305,7 @@ Pass all responses, regardless of its status code.MetaCopyDetectionMiddleware----------------------------.. module:: scrapy.spidermiddlewares.metacopy- :synopsis: Meta Copy Detection Spider Middleware--.. class:: MetaCopyDetectionMiddleware+.. class:: scrapy.spidermiddlewares.metacopy.MetaCopyDetectionMiddlewareWarns when a spider yields a request that contains internal meta keys whichshould not be copied from :attr:`response.meta <scrapy.http.Response.meta>`@@ -342,7 +332,6 @@ RefererMiddleware-----------------.. module:: scrapy.spidermiddlewares.referer- :synopsis: Referer Spider Middleware.. class:: RefererMiddleware@@ -366,7 +355,7 @@ Whether to enable referer middleware.REFERRER_POLICY^^^^^^^^^^^^^^^-Default: ``'scrapy.spidermiddlewares.referer.DefaultReferrerPolicy'``+Default: ``"scrapy.spidermiddlewares.referer.DefaultReferrerPolicy"``.. reqmeta:: referrer_policy@@ -382,24 +371,24 @@ Default: ``'scrapy.spidermiddlewares.referer.DefaultReferrerPolicy'``Acceptable values for REFERRER_POLICY*************************************-- either a path to a :class:`scrapy.spidermiddlewares.referer.ReferrerPolicy`- subclass — a custom policy or one of the built-in ones (see classes below),+- either a path to a :class:`ReferrerPolicy` subclass — a custom policy or one+ of the built-in ones (see classes below),- or one or more comma-separated standard W3C-defined string values,- or the special ``"scrapy-default"``.-======================================= ========================================================================-String value Class name (as a string)-======================================= ========================================================================-``"scrapy-default"`` (default) :class:`scrapy.spidermiddlewares.referer.DefaultReferrerPolicy`-`"no-referrer"`_ :class:`scrapy.spidermiddlewares.referer.NoReferrerPolicy`-`"no-referrer-when-downgrade"`_ :class:`scrapy.spidermiddlewares.referer.NoReferrerWhenDowngradePolicy`-`"same-origin"`_ :class:`scrapy.spidermiddlewares.referer.SameOriginPolicy`-`"origin"`_ :class:`scrapy.spidermiddlewares.referer.OriginPolicy`-`"strict-origin"`_ :class:`scrapy.spidermiddlewares.referer.StrictOriginPolicy`-`"origin-when-cross-origin"`_ :class:`scrapy.spidermiddlewares.referer.OriginWhenCrossOriginPolicy`-`"strict-origin-when-cross-origin"`_ :class:`scrapy.spidermiddlewares.referer.StrictOriginWhenCrossOriginPolicy`-`"unsafe-url"`_ :class:`scrapy.spidermiddlewares.referer.UnsafeUrlPolicy`-======================================= ========================================================================+======================================= ==========================================+String value Class+======================================= ==========================================+``"scrapy-default"`` (default) :class:`DefaultReferrerPolicy`+`"no-referrer"`_ :class:`NoReferrerPolicy`+`"no-referrer-when-downgrade"`_ :class:`NoReferrerWhenDowngradePolicy`+`"same-origin"`_ :class:`SameOriginPolicy`+`"origin"`_ :class:`OriginPolicy`+`"strict-origin"`_ :class:`StrictOriginPolicy`+`"origin-when-cross-origin"`_ :class:`OriginWhenCrossOriginPolicy`+`"strict-origin-when-cross-origin"`_ :class:`StrictOriginWhenCrossOriginPolicy`+`"unsafe-url"`_ :class:`UnsafeUrlPolicy`+======================================= ==========================================.. autoclass:: ReferrerPolicy@@ -455,9 +444,8 @@ REFERRER_POLICIESDefault: ``{}``-A dictionary mapping policy names to import paths of-:class:`scrapy.spidermiddlewares.referer.ReferrerPolicy` subclasses, or-``None`` to disable support for a given policy name.+A dictionary mapping policy names to import paths of :class:`ReferrerPolicy`+subclasses, or ``None`` to disable support for a given policy name.This allows overriding the policies triggered by the ``Referrer-Policy``response header.@@ -465,26 +453,23 @@ response header.Use ``""`` to override the policy for responses with `no referrer policy<https://www.w3.org/TR/referrer-policy/#referrer-policy-empty-string>`__.+.. currentmodule:: None+StartSpiderMiddleware----------------------.. module:: scrapy.spidermiddlewares.start--.. autoclass:: StartSpiderMiddleware+.. autoclass:: scrapy.spidermiddlewares.start.StartSpiderMiddlewareUrlLengthMiddleware--------------------.. module:: scrapy.spidermiddlewares.urllength- :synopsis: URL Length Spider Middleware--.. class:: UrlLengthMiddleware+.. class:: scrapy.spidermiddlewares.urllength.UrlLengthMiddlewareFilters out requests with URLs longer than URLLENGTH_LIMIT- The :class:`UrlLengthMiddleware` can be configured through the following+ This middleware can be configured through the followingsettings (see the settings documentation for more info):* :setting:`URLLENGTH_LIMIT` - The maximum URL length to allow for crawled URLs.diff --git a/docs/topics/telnetconsole.rst b/docs/topics/telnetconsole.rstindex ffba2346a..3a22a81c2 100644--- a/docs/topics/telnetconsole.rst+++ b/docs/topics/telnetconsole.rst@@ -1,4 +1,4 @@-.. currentmodule:: scrapy.extensions.telnet+.. module:: scrapy.extensions.telnet.. _topics-telnetconsole: