Rule.process_request: docs

This commit is contained in:
Eugenio Lacuesta 2019-03-13 11:02:51 +00:00
parent 22fda61d62
commit b30ca379b6
1 changed files with 6 additions and 4 deletions

View File

@ -402,10 +402,12 @@ Crawling rules
of links extracted from each response using the specified ``link_extractor``.
This is mainly used for filtering purposes.
``process_request`` is a callable, or a string (in which case a method from
the spider object with that name will be used) which will be called with
every request extracted by this rule, and must return a request or None (to
filter out the request).
``process_request`` is a callable (or a string, in which case a method from
the spider object with that name will be used) which will be called for
every request extracted by this rule. This callable should take a Request object
as first positional argument and, optionally, the Response object from which the
Request originated as second positional argument. It must return a request or None
(to filter out the request).
CrawlSpider example
~~~~~~~~~~~~~~~~~~~