Scrapy, a fast high-level web crawling & scraping framework for Python.
[docs] update redirect links python2 -> python3
Adityaca08e04198b9
diff --git a/docs/topics/downloader-middleware.rst b/docs/topics/downloader-middleware.rstindex 73648994d..61a3806fb 100644--- a/docs/topics/downloader-middleware.rst+++ b/docs/topics/downloader-middleware.rst@@ -739,7 +739,7 @@ HttpProxyMiddlewareThis middleware sets the HTTP proxy to use for requests, by setting the``proxy`` meta value for :class:`~scrapy.http.Request` objects.- Like the Python standard library modules `urllib`_ and `urllib2`_, it obeys+ Like the Python standard library module `urllib.request`_, it obeysthe following environment variables:* ``http_proxy``@@ -751,8 +751,7 @@ HttpProxyMiddlewareKeep in mind this value will take precedence over ``http_proxy``/``https_proxy``environment variables, and it will also ignore ``no_proxy`` environment variable.-.. _urllib: https://docs.python.org/2/library/urllib.html-.. _urllib2: https://docs.python.org/2/library/urllib2.html+.. _urllib.request: https://docs.python.org/3/library/urllib.request.htmlRedirectMiddleware------------------diff --git a/docs/topics/email.rst b/docs/topics/email.rstindex 72bf52227..aed3deb2e 100644--- a/docs/topics/email.rst+++ b/docs/topics/email.rst@@ -15,7 +15,7 @@ IO of the crawler. It also provides a simple API for sending attachments andit's very easy to configure, with a few :ref:`settings<topics-email-settings>`.-.. _smtplib: https://docs.python.org/2/library/smtplib.html+.. _smtplib: https://docs.python.org/3/library/smtplib.htmlQuick example=============diff --git a/docs/topics/exporters.rst b/docs/topics/exporters.rstindex e52682690..4ba8714bd 100644--- a/docs/topics/exporters.rst+++ b/docs/topics/exporters.rst@@ -320,7 +320,7 @@ CsvItemExporterColor TV,1200DVD player,200-.. _csv.writer: https://docs.python.org/2/library/csv.html#csv.writer+.. _csv.writer: https://docs.python.org/3/library/csv.html#csv.writerPickleItemExporter------------------@@ -342,7 +342,7 @@ PickleItemExporterPickle isn't a human readable format, so no output examples are provided.-.. _pickle module documentation: https://docs.python.org/2/library/pickle.html+.. _pickle module documentation: https://docs.python.org/3/library/pickle.htmlPprintItemExporter------------------@@ -393,7 +393,7 @@ JsonItemExporterstream-friendly format, consider using :class:`JsonLinesItemExporter`instead, or splitting the output in multiple chunks.-.. _JSONEncoder: https://docs.python.org/2/library/json.html#json.JSONEncoder+.. _JSONEncoder: https://docs.python.org/3/library/json.html#json.JSONEncoderJsonLinesItemExporter---------------------@@ -417,7 +417,7 @@ JsonLinesItemExporterUnlike the one produced by :class:`JsonItemExporter`, the format produced bythis exporter is well suited for serializing large amounts of data.-.. _JSONEncoder: https://docs.python.org/2/library/json.html#json.JSONEncoder+.. _JSONEncoder: https://docs.python.org/3/library/json.html#json.JSONEncoderMarshalItemExporter-------------------diff --git a/docs/topics/extensions.rst b/docs/topics/extensions.rstindex 94fd2e36e..f57e37e6f 100644--- a/docs/topics/extensions.rst+++ b/docs/topics/extensions.rst@@ -372,5 +372,5 @@ For more info see `Debugging in Python`_.This extension only works on POSIX-compliant platforms (i.e. not Windows).-.. _Python debugger: https://docs.python.org/2/library/pdb.html+.. _Python debugger: https://docs.python.org/3/library/pdb.html.. _Debugging in Python: https://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/diff --git a/docs/topics/items.rst b/docs/topics/items.rstindex 44643cb67..36731571e 100644--- a/docs/topics/items.rst+++ b/docs/topics/items.rst@@ -24,7 +24,7 @@ serialization can be customized using Item fields metadata, :mod:`trackref`tracks Item instances to help find memory leaks(see :ref:`topics-leaks-trackrefs`), etc.-.. _dictionary-like: https://docs.python.org/2/library/stdtypes.html#dict+.. _dictionary-like: https://docs.python.org/3/library/stdtypes.html#dict.. _topics-items-declaring:@@ -249,7 +249,7 @@ Item objects:class:`Field` objects used in the :ref:`Item declaration<topics-items-declaring>`.-.. _dict API: https://docs.python.org/2/library/stdtypes.html#dict+.. _dict API: https://docs.python.org/3/library/stdtypes.html#dictField objects=============@@ -262,7 +262,7 @@ Field objectsto support the :ref:`item declaration syntax <topics-items-declaring>`based on class attributes.-.. _dict: https://docs.python.org/2/library/stdtypes.html#dict+.. _dict: https://docs.python.org/3/library/stdtypes.html#dictOther classes related to Itemdiff --git a/docs/topics/logging.rst b/docs/topics/logging.rstindex d4d22d889..a85e1a769 100644--- a/docs/topics/logging.rst+++ b/docs/topics/logging.rst@@ -83,10 +83,10 @@ path::.. seealso::- Module logging, `HowTo <https://docs.python.org/2/howto/logging.html>`_+ Module logging, `HowTo <https://docs.python.org/3/howto/logging.html>`_Basic Logging Tutorial- Module logging, `Loggers <https://docs.python.org/2/library/logging.html#logger-objects>`_+ Module logging, `Loggers <https://docs.python.org/3/library/logging.html#logger-objects>`_Further documentation on loggers.. _topics-logging-from-spiders:@@ -166,13 +166,13 @@ possible levels listed in :ref:`topics-logging-levels`.:setting:`LOG_FORMAT` and :setting:`LOG_DATEFORMAT` specify formatting stringsused as layouts for all messages. Those strings can contain any placeholderslisted in `logging's logrecord attributes docs-<https://docs.python.org/2/library/logging.html#logrecord-attributes>`_ and+<https://docs.python.org/3/library/logging.html#logrecord-attributes>`_ and`datetime's strftime and strptime directives-<https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior>`_+<https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior>`_respectively.If :setting:`LOG_SHORT_NAMES` is set, then the logs will not display the Scrapy-component that prints the log. It is unset by default, hence logs contain the+component that prints the log. It is unset by default, hence logs contain theScrapy component responsible for that log output.Command-line options@@ -190,7 +190,7 @@ to override some of the Scrapy settings regarding logging... seealso::- Module `logging.handlers <https://docs.python.org/2/library/logging.handlers.html>`_+ Module `logging.handlers <https://docs.python.org/3/library/logging.handlers.html>`_Further documentation on available handlers.. _custom-log-formats:@@ -201,7 +201,7 @@ Custom Log FormatsA custom log format can be set for different actions by extending:class:`~scrapy.logformatter.LogFormatter` class and making:setting:`LOG_FORMATTER` point to your new class.-+.. autoclass:: scrapy.logformatter.LogFormatter:members:@@ -276,6 +276,6 @@ scrapy.utils.log moduleRefer to :ref:`run-from-script` for more details about using Scrapy thisway.-.. _logging.basicConfig(): https://docs.python.org/2/library/logging.html#logging.basicConfig+.. _logging.basicConfig(): https://docs.python.org/3/library/logging.html#logging.basicConfigdiff --git a/docs/topics/request-response.rst b/docs/topics/request-response.rstindex b2a60ff39..6c5a08409 100644--- a/docs/topics/request-response.rst+++ b/docs/topics/request-response.rst@@ -189,7 +189,7 @@ Request objects``copy()`` or ``replace()`` methods, and can also be accessed, in yourspider, from the ``response.cb_kwargs`` attribute.- .. _shallow copied: https://docs.python.org/2/library/copy.html+ .. _shallow copied: https://docs.python.org/3/library/copy.html.. method:: Request.copy()@@ -706,7 +706,7 @@ Response objectsA :class:`twisted.internet.ssl.Certificate` object representingthe server's SSL certificate.-+Only populated for ``https`` responses, ``None`` otherwise... method:: Response.copy()@@ -724,17 +724,17 @@ Response objectsConstructs an absolute url by combining the Response's :attr:`url` witha possible relative url.- This is a wrapper over `urlparse.urljoin`_, it's merely an alias for+ This is a wrapper over `urllib.parse.urljoin`_, it's merely an alias formaking this call::- urlparse.urljoin(response.url, url)+ urllib.parse.urljoin(response.url, url).. automethod:: Response.follow.. automethod:: Response.follow_all-.. _urlparse.urljoin: https://docs.python.org/2/library/urlparse.html#urlparse.urljoin+.. _urllib.parse.urljoin: https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urljoin.. _topics-request-response-ref-response-subclasses:diff --git a/docs/topics/selectors.rst b/docs/topics/selectors.rstindex 1f7802c98..0f90b28c0 100644--- a/docs/topics/selectors.rst+++ b/docs/topics/selectors.rst@@ -36,7 +36,7 @@ defines selectors to associate those styles with specific HTML elements... _BeautifulSoup: https://www.crummy.com/software/BeautifulSoup/.. _lxml: https://lxml.de/-.. _ElementTree: https://docs.python.org/2/library/xml.etree.elementtree.html+.. _ElementTree: https://docs.python.org/3/library/xml.etree.elementtree.html.. _XPath: https://www.w3.org/TR/xpath/all/.. _CSS: https://www.w3.org/TR/selectors.. _parsel: https://parsel.readthedocs.io/en/latest/diff --git a/docs/topics/settings.rst b/docs/topics/settings.rstindex dc6843d75..d78a6253e 100644--- a/docs/topics/settings.rst+++ b/docs/topics/settings.rst@@ -28,7 +28,7 @@ The value of ``SCRAPY_SETTINGS_MODULE`` should be in Python path syntax, e.g.``myproject.settings``. Note that the settings module should be on thePython `import search path`_.-.. _import search path: https://docs.python.org/2/tutorial/modules.html#the-module-search-path+.. _import search path: https://docs.python.org/3/tutorial/modules.html#the-module-search-path.. _populating-settings:@@ -902,7 +902,7 @@ Default: ``'%(asctime)s [%(name)s] %(levelname)s: %(message)s'``String for formatting log messages. Refer to the `Python logging documentation`_ for the whole list of availableplaceholders.-.. _Python logging documentation: https://docs.python.org/2/library/logging.html#logrecord-attributes+.. _Python logging documentation: https://docs.python.org/3/library/logging.html#logrecord-attributes.. setting:: LOG_DATEFORMAT@@ -915,7 +915,7 @@ String for formatting date/time, expansion of the ``%(asctime)s`` placeholderin :setting:`LOG_FORMAT`. Refer to the `Python datetime documentation`_ for the whole list of availabledirectives.-.. _Python datetime documentation: https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior+.. _Python datetime documentation: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior.. setting:: LOG_FORMATTERdiff --git a/docs/topics/spider-middleware.rst b/docs/topics/spider-middleware.rstindex 0e8210130..3d7450c86 100644--- a/docs/topics/spider-middleware.rst+++ b/docs/topics/spider-middleware.rst@@ -173,18 +173,18 @@ object gives you access, for example, to the :ref:`settings <topics-settings>`.:type spider: :class:`~scrapy.spiders.Spider` object.. method:: from_crawler(cls, crawler)-+If present, this classmethod is called to create a middleware instancefrom a :class:`~scrapy.crawler.Crawler`. It must return a new instanceof the middleware. Crawler object provides access to all Scrapy corecomponents like settings and signals; it is a way for middleware toaccess them and hook its functionality into Scrapy.-+:param crawler: crawler that uses this middleware:type crawler: :class:`~scrapy.crawler.Crawler` object-.. _Exception: https://docs.python.org/2/library/exceptions.html#exceptions.Exception+.. _Exception: https://docs.python.org/3/library/exceptions.html#Exception.. _topics-spider-middleware-ref: