Skip to content

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

Document setting request priority in CrawlSpider rules (#8070)

Adrian753f3afa438c
diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst
index f73e30a02..a932dc72f 100644
--- a/docs/topics/spiders.rst
+++ b/docs/topics/spiders.rst
@@ -541,6 +541,10 @@ Crawling rules
from which the request originated as second argument. It must return a
``Request`` object or ``None`` (to filter out the request).
+ Use ``process_request`` to set the :attr:`~scrapy.Request.priority` of
+ requests generated by a rule, e.g. ``process_request=lambda request,
+ response: request.replace(priority=10)``.
+
``errback`` is a callable or a string (in which case a method from the spider
object with that name will be used) to be called if any exception is
raised while processing a request generated by the rule.