makes suggested changes

This commit is contained in:
Anubhav Patel 2019-08-27 18:44:08 +05:30
parent 00fe05e536
commit 77c8ab2e62
2 changed files with 8 additions and 16 deletions

View File

@ -989,6 +989,12 @@ RobotsTxtMiddleware
To make sure Scrapy respects robots.txt make sure the middleware is enabled
and the :setting:`ROBOTSTXT_OBEY` setting is enabled.
The :setting:`ROBOTSTXT_USER_AGENT` setting can be used to specify the
user agent string to use for matching in the robots.txt_ file. If it
is ``None``, the User-Agent header you are sending with the request or the
:setting:`USER_AGENT` setting (in that order) will be used for determining
the user agent to use in the robots.txt_ file.
This middleware has to be combined with a robots.txt_ parser.
Scrapy ships with support for the following robots.txt_ parsers:
@ -1074,21 +1080,6 @@ implementing the methods described below.
.. autoclass:: RobotParser
:members:
RobotsTxtMiddleware Settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. setting:: ROBOTSTXT_USER_AGENT
ROBOTSTXT_USER_AGENT
^^^^^^^^^^^^^^^^^^^^
Default: ``None``
The user agent string to use for matching in the robots.txt_ file. If ``None``,
the User-Agent header you are sending with the request or the
:setting:`USER_AGENT` setting (in that order) will be used for determining
the user agent to use in the robots.txt_ file.
.. _robots.txt: http://www.robotstxt.org/
DownloaderStats

View File

@ -1422,7 +1422,8 @@ USER_AGENT
Default: ``"Scrapy/VERSION (+https://scrapy.org)"``
The default User-Agent to use when crawling, unless overridden. This user agent is
also used in robots.txt if :setting:`ROBOTSTXT_USER_AGENT` setting is ``None`` and
also used by :class:`~scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware`
if :setting:`ROBOTSTXT_USER_AGENT` setting is ``None`` and
there is no overridding User-Agent header specified for the request.