Document that the main entry point of downloader and spider middlewares is from_crawler()

This commit is contained in:
Adrián Chaves 2019-02-13 17:39:20 +01:00
parent b364bfb68b
commit 50bf4c60c4
2 changed files with 12 additions and 4 deletions

View File

@ -55,8 +55,12 @@ particular setting. See each middleware documentation for more info.
Writing your own downloader middleware
======================================
Each middleware component is a Python class that defines one or
more of the following methods:
Each downloader middleware is a Python class that defines one or more of the
methods defined below.
The main entry point is the ``from_crawler`` class method, which receives a
:class:`~scrapy.crawler.Crawler` instance. The :class:`~scrapy.crawler.Crawler`
object gives you access, for example, to the :ref:`settings <topics-settings>`.
.. module:: scrapy.downloadermiddlewares

View File

@ -57,8 +57,12 @@ particular setting. See each middleware documentation for more info.
Writing your own spider middleware
==================================
Each middleware component is a Python class that defines one or more of the
following methods:
Each spider middleware is a Python class that defines one or more of the
methods defined below.
The main entry point is the ``from_crawler`` class method, which receives a
:class:`~scrapy.crawler.Crawler` instance. The :class:`~scrapy.crawler.Crawler`
object gives you access, for example, to the :ref:`settings <topics-settings>`.
.. module:: scrapy.spidermiddlewares