urllib2.md
1> **Источник:** https://python-all.ru/3.2/howto/urllib2.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# HOWTO получение интернет-ресурсов с помощью пакета urllib89| Автор: | [Michael Foord](https://python-all.ru/3.2/howto/urllib2.html) |10| --- | --- |1112> **Примечание**13>14> Существует французский перевод более ранней версии этого руководства, доступный по адресу [urllib2 - Le Manuel manquant](https://python-all.ru/3.2/howto/urllib2.html).1516## Введение1718Связанные статьи1920Возможно, вам также будет полезна следующая статья о получении веб-ресурсов с помощью Python:2122- [Базовая аутентификация](https://python-all.ru/3.2/howto/urllib2.html)2324 > Учебник по *базовой аутентификации* с примерами на Python.2526**urllib.request** – это модуль [Python](https://python-all.ru/3.2/howto/urllib2.html) для получения URL (Uniform Resource Locators). Он предоставляет очень простой интерфейс в виде функции *urlopen*. Эта функция может получать URL с использованием различных протоколов. Также он предоставляет немного более сложный интерфейс для обработки типичных ситуаций, таких как базовая аутентификация, куки, прокси и т.д. Эти возможности обеспечиваются объектами, называемыми обработчиками и открывателями.2728urllib.request поддерживает получение URL для многих «схем URL» (определяемых строкой до двоеточия в URL – например, «ftp» – это схема URL для «[ftp://python.org/](ftp://python.org/)») с использованием связанных с ними сетевых протоколов (например, FTP, HTTP). Данное руководство фокусируется на наиболее распространённом случае – HTTP.2930For straightforward situations *urlopen* is very easy to use. But as soon as you encounter errors or non-trivial cases when opening HTTP URLs, you will need some understanding of the HyperText Transfer Protocol. The most comprehensive and authoritative reference to HTTP is [**RFC 2616**](https://python-all.ru/3.2/howto/urllib2.html). This is a technical document and not intended to be easy to read. This HOWTO aims to illustrate using *urllib*, with enough detail about HTTP to help you through. It is not intended to replace the [`urllib.request`](https://python-all.ru/3.2/library/urllib.request.html#module-urllib.request) docs, but is supplementary to them.3132## Загрузка URL3334Простейший способ использования urllib.request выглядит так:3536```python37import urllib.request38response = urllib.request.urlopen('http://python.org/')39html = response.read()40```4142Многие случаи использования urllib будут настолько же простыми (обратите внимание, что вместо URL с ‘http:’ мы могли бы использовать URL, начинающийся с ‘ftp:’, ‘file:’ и т.д.). Однако цель данного руководства – объяснить более сложные случаи, сосредоточившись на HTTP.4344HTTP is based on requests and responses - the client makes requests and servers send responses. urllib.request mirrors this with a `Request` object which represents the HTTP request you are making. In its simplest form you create a Request object that specifies the URL you want to fetch. Calling `urlopen` with this Request object returns a response object for the URL requested. This response is a file-like object, which means you can for example call `.read()` on the response:4546```python47import urllib.request4849req = urllib.request.Request('http://www.voidspace.org.uk')50response = urllib.request.urlopen(req)51the_page = response.read()52```5354Обратите внимание, что urllib.request использует тот же интерфейс Request для обработки всех схем URL. Например, можно сделать FTP-запрос так:5556```python57req = urllib.request.Request('ftp://example.com/')58```5960В случае HTTP объекты Request позволяют сделать ещё две вещи: во-первых, можно передать данные для отправки на сервер. Во-вторых, можно передать серверу дополнительную информацию («метаданные») *о* данных или о самом запросе – эта информация отправляется в виде HTTP-заголовков. Рассмотрим каждую из них по очереди.6162### Данные6364Иногда требуется отправить данные на URL (часто URL ссылается на CGI-скрипт (Common Gateway Interface) [\[1\]](https://python-all.ru/3.2/howto/urllib2.html#id9) или другое веб-приложение). В HTTP это обычно делается с помощью так называемого **POST**-запроса. Именно так ваш браузер отправляет заполненную HTML-форму. Не все POST-запросы должны приходить из форм: можно использовать POST для передачи произвольных данных в собственное приложение. В типичном случае HTML-форм данные необходимо закодировать стандартным способом, а затем передать в объект Request в качестве аргумента `data`. Кодирование выполняется с помощью функции из библиотеки [`urllib.parse`](https://python-all.ru/3.2/library/urllib.parse.html#module-urllib.parse).6566```python67import urllib.parse68import urllib.request6970url = 'http://www.someserver.com/cgi-bin/register.cgi'71values = {'name' : 'Michael Foord',72 'location' : 'Northampton',73 'language' : 'Python' }7475data = urllib.parse.urlencode(values)76data = data.encode('utf-8') # data должна быть типа bytes77req = urllib.request.Request(url, data)78response = urllib.request.urlopen(req)79the_page = response.read()80```8182Обратите внимание, что иногда требуются другие кодировки (например, для загрузки файлов из HTML-форм – подробнее см. [Спецификацию HTML, раздел «Отправка формы»](https://python-all.ru/3.2/howto/urllib2.html)).8384If you do not pass the `data` argument, urllib uses a **GET** request. One way in which GET and POST requests differ is that POST requests often have “side-effects”: they change the state of the system in some way (for example by placing an order with the website for a hundredweight of tinned spam to be delivered to your door). Though the HTTP standard makes it clear that POSTs are intended to *always* cause side-effects, and GET requests *never* to cause side-effects, nothing prevents a GET request from having side-effects, nor a POST requests from having no side-effects. Data can also be passed in an HTTP GET request by encoding it in the URL itself.8586Это делается следующим образом:8788```python89>>> import urllib.request90>>> import urllib.parse91>>> data = {}92>>> data['name'] = 'Somebody Here'93>>> data['location'] = 'Northampton'94>>> data['language'] = 'Python'95>>> url_values = urllib.parse.urlencode(data)96>>> print(url_values) # Порядок может отличаться от указанного ниже. 97name=Somebody+Here&language=Python&location=Northampton98>>> url = 'http://www.example.com/example.cgi'99>>> full_url = url + '?' + url_values100>>> data = urllib.request.urlopen(full_url)101```102103Обратите внимание, что полный URL создаётся добавлением `?` к URL, после которого следуют закодированные значения.104105### Заголовки106107Здесь будет рассмотрен один конкретный HTTP-заголовок, чтобы проиллюстрировать, как добавлять заголовки в HTTP-запросы.108109Некоторым сайтам [\[2\]](https://python-all.ru/3.2/howto/urllib2.html#id10) не нравится, когда их просматривают программы, или они отправляют разные версии разным браузерам [\[3\]](https://python-all.ru/3.2/howto/urllib2.html#id11). По умолчанию urllib идентифицирует себя как `Python-urllib/x.y` (где `x` и `y` – это номера старшей и младшей версии релиза Python, например `Python-urllib/2.5`), что может сбивать сайт с толку или просто не работать. Способ, которым браузер идентифицирует себя, – это заголовок `User-Agent` [\[4\]](https://python-all.ru/3.2/howto/urllib2.html#id12). При создании объекта Request можно передать словарь заголовков. В следующем примере выполняется тот же запрос, что и выше, но идентифицируется как версия Internet Explorer [\[5\]](https://python-all.ru/3.2/howto/urllib2.html#id13).110111```python112import urllib.parse113import urllib.request114115url = 'http://www.someserver.com/cgi-bin/register.cgi'116user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'117values = {'name' : 'Michael Foord',118 'location' : 'Northampton',119 'language' : 'Python' }120headers = { 'User-Agent' : user_agent }121122data = urllib.parse.urlencode(values)123data = data.encode('utf-8')124req = urllib.request.Request(url, data, headers)125response = urllib.request.urlopen(req)126the_page = response.read()127```128129Ответ также имеет два полезных метода. См. раздел [info и geturl](https://python-all.ru/3.2/howto/urllib2.html#info-and-geturl), который следует после того, как мы рассмотрим, что происходит, когда что-то идёт не так.130131## Обработка исключений132133*urlopen* raises `URLError` when it cannot handle a response (though as usual with Python APIs, built-in exceptions such as [`ValueError`](https://python-all.ru/3.2/library/exceptions.html#ValueError), [`TypeError`](https://python-all.ru/3.2/library/exceptions.html#TypeError) etc. may also be raised).134135`HTTPError` is the subclass of `URLError` raised in the specific case of HTTP URLs.136137The exception classes are exported from the [`urllib.error`](https://python-all.ru/3.2/library/urllib.error.html#module-urllib.error) module.138139### URLError140141Часто URLError возникает из-за отсутствия сетевого соединения (нет маршрута к указанному серверу) или потому что указанный сервер не существует. В этом случае возбуждённое исключение будет иметь атрибут 'reason', который представляет собой кортеж, содержащий код ошибки и текстовое сообщение об ошибке.142143например144145```python146>>> req = urllib.request.Request('http://www.pretend_server.org')147>>> try: urllib.request.urlopen(req)148... except urllib.error.URLError as e:149... print(e.reason) 150...151(4, 'getaddrinfo failed')152```153154### HTTPError155156Every HTTP response from the server contains a numeric “status code”. Sometimes the status code indicates that the server is unable to fulfil the request. The default handlers will handle some of these responses for you (for example, if the response is a “redirection” that requests the client fetch the document from a different URL, urllib will handle that for you). For those it can’t handle, urlopen will raise an `HTTPError`. Typical errors include ‘404’ (page not found), ‘403’ (request forbidden), and ‘401’ (authentication required).157158Все коды ошибок HTTP перечислены в разделе 10 документа RFC 2616.159160The `HTTPError` instance raised will have an integer ‘code’ attribute, which corresponds to the error sent by the server.161162#### Коды ошибок163164Поскольку обработчики по умолчанию обрабатывают перенаправления (коды в диапазоне 300), а коды в диапазоне 100-299 указывают на успех, вы обычно будете видеть коды ошибок только в диапазоне 400-599.165166[`http.server.BaseHTTPRequestHandler.responses`](https://python-all.ru/3.2/library/http.server.html#http.server.BaseHTTPRequestHandler.responses) is a useful dictionary of response codes in that shows all the response codes used by RFC 2616. The dictionary is reproduced here for convenience167168```python169# Таблица, сопоставляющая коды ответов с сообщениями; записи имеют170# вид {code: (shortmessage, longmessage)}.171responses = {172 100: ('Continue', 'Request received, please continue'),173 101: ('Switching Protocols',174 'Switching to new protocol; obey Upgrade header'),175176 200: ('OK', 'Request fulfilled, document follows'),177 201: ('Created', 'Document created, URL follows'),178 202: ('Accepted',179 'Request accepted, processing continues off-line'),180 203: ('Non-Authoritative Information', 'Request fulfilled from cache'),181 204: ('No Content', 'Request fulfilled, nothing follows'),182 205: ('Reset Content', 'Clear input form for further input.'),183 206: ('Partial Content', 'Partial content follows.'),184185 300: ('Multiple Choices',186 'Object has several resources -- see URI list'),187 301: ('Moved Permanently', 'Object moved permanently -- see URI list'),188 302: ('Found', 'Object moved temporarily -- see URI list'),189 303: ('See Other', 'Object moved -- see Method and URL list'),190 304: ('Not Modified',191 'Document has not changed since given time'),192 305: ('Use Proxy',193 'You must use proxy specified in Location to access this '194 'resource.'),195 307: ('Temporary Redirect',196 'Object moved temporarily -- see URI list'),197198 400: ('Bad Request',199 'Bad request syntax or unsupported method'),200 401: ('Unauthorized',201 'No permission -- see authorization schemes'),202 402: ('Payment Required',203 'No payment -- see charging schemes'),204 403: ('Forbidden',205 'Request forbidden -- authorization will not help'),206 404: ('Not Found', 'Nothing matches the given URI'),207 405: ('Method Not Allowed',208 'Specified method is invalid for this server.'),209 406: ('Not Acceptable', 'URI not available in preferred format.'),210 407: ('Proxy Authentication Required', 'You must authenticate with '211 'this proxy before proceeding.'),212 408: ('Request Timeout', 'Request timed out; try again later.'),213 409: ('Conflict', 'Request conflict.'),214 410: ('Gone',215 'URI no longer exists and has been permanently removed.'),216 411: ('Length Required', 'Client must specify Content-Length.'),217 412: ('Precondition Failed', 'Precondition in headers is false.'),218 413: ('Request Entity Too Large', 'Entity is too large.'),219 414: ('Request-URI Too Long', 'URI is too long.'),220 415: ('Unsupported Media Type', 'Entity body in unsupported format.'),221 416: ('Requested Range Not Satisfiable',222 'Cannot satisfy request range.'),223 417: ('Expectation Failed',224 'Expect condition could not be satisfied.'),225226 500: ('Internal Server Error', 'Server got itself in trouble'),227 501: ('Not Implemented',228 'Server does not support this operation'),229 502: ('Bad Gateway', 'Invalid responses from another server/proxy.'),230 503: ('Service Unavailable',231 'The server cannot process the request due to a high load'),232 504: ('Gateway Timeout',233 'The gateway server did not receive a timely response'),234 505: ('HTTP Version Not Supported', 'Cannot fulfill request.'),235 }236```237238When an error is raised the server responds by returning an HTTP error code *and* an error page. You can use the `HTTPError` instance as a response on the page returned. This means that as well as the code attribute, it also has read, geturl, and info, methods as returned by the `urllib.response` module:239240```python241>>> req = urllib.request.Request('http://www.python.org/fish.html')242>>> try:243... urllib.request.urlopen(req)244... except urllib.error.HTTPError as e:245... print(e.code)246... print(e.read()) 247...248404249b'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"250 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n\n\n<html251 ...252 <title>Page Not Found</title>\n253 ...254```255256### Резюме257258So if you want to be prepared for `HTTPError` *or* `URLError` there are two basic approaches. I prefer the second approach.259260#### Способ 1261262```python263from urllib.request import Request, urlopen264from urllib.error import URLError, HTTPError265req = Request(someurl)266try:267 response = urlopen(req)268except HTTPError as e:269 print('The server couldn\'t fulfill the request.')270 print('Error code: ', e.code)271except URLError as e:272 print('We failed to reach a server.')273 print('Reason: ', e.reason)274else:275 # всё в порядке276```277278> **Примечание**279>280> The `except HTTPError` *must* come first, otherwise `except URLError` will *also* catch an `HTTPError`.281282#### Способ 2283284```python285from urllib.request import Request, urlopen286from urllib.error import URLError287req = Request(someurl)288try:289 response = urlopen(req)290except URLError as e:291 if hasattr(e, 'reason'):292 print('We failed to reach a server.')293 print('Reason: ', e.reason)294 elif hasattr(e, 'code'):295 print('The server couldn\'t fulfill the request.')296 print('Error code: ', e.code)297else:298 # всё в порядке299```300301## info и geturl302303The response returned by urlopen (or the `HTTPError` instance) has two useful methods `info()` and `geturl()` and is defined in the module [`urllib.response`](https://python-all.ru/3.2/library/urllib.request.html#module-urllib.response)..304305**geturl** - this returns the real URL of the page fetched. This is useful because `urlopen` (or the opener object used) may have followed a redirect. The URL of the page fetched may not be the same as the URL requested.306307**info** - this returns a dictionary-like object that describes the page fetched, particularly the headers sent by the server. It is currently an `http.client.HTTPMessage` instance.308309Типичные заголовки включают ‘Content-length’, ‘Content-type’ и т.д. Смотрите [Краткий справочник HTTP-заголовков](https://python-all.ru/3.2/howto/urllib2.html) для полезного списка HTTP-заголовков с краткими пояснениями их значения и использования.310311## Открыватели и обработчики312313When you fetch a URL you use an opener (an instance of the perhaps confusingly-named [`urllib.request.OpenerDirector`](https://python-all.ru/3.2/library/urllib.request.html#urllib.request.OpenerDirector)). Normally we have been using the default opener - via `urlopen` - but you can create custom openers. Openers use handlers. All the “heavy lifting” is done by the handlers. Each handler knows how to open URLs for a particular URL scheme (http, ftp, etc.), or how to handle an aspect of URL opening, for example HTTP redirections or HTTP cookies.314315Стоит создавать собственные opener'ы, если нужно получать URL с установленными определёнными обработчиками, например чтобы получить opener, обрабатывающий cookies, или opener, не обрабатывающий перенаправления.316317To create an opener, instantiate an `OpenerDirector`, and then call `.add_handler(some_handler_instance)` repeatedly.318319Alternatively, you can use `build_opener`, which is a convenience function for creating opener objects with a single function call. `build_opener` adds several handlers by default, but provides a quick way to add more and/or override the default handlers.320321Другие типы обработчиков могут обрабатывать прокси, аутентификацию и другие распространённые, но слегка специализированные ситуации.322323`install_opener` can be used to make an `opener` object the (global) default opener. This means that calls to `urlopen` will use the opener you have installed.324325Opener objects have an `open` method, which can be called directly to fetch urls in the same way as the `urlopen` function: there’s no need to call `install_opener`, except as a convenience.326327## Базовая аутентификация328329To illustrate creating and installing a handler we will use the `HTTPBasicAuthHandler`. For a more detailed discussion of this subject – including an explanation of how Basic Authentication works - see the [Basic Authentication Tutorial](https://python-all.ru/3.2/howto/urllib2.html).330331Когда требуется аутентификация, сервер отправляет заголовок (а также код ошибки 401) с запросом аутентификации. В нем указываются схема аутентификации и «realm». Заголовок выглядит так: `WWW-Authenticate: SCHEME realm="REALM"`.332333например334335```python336WWW-Authenticate: Basic realm="cPanel Users"337```338339Затем клиент должен повторить запрос, указав соответствующие имя и пароль для области (realm) в качестве заголовка запроса. Это называется «базовая аутентификация». Чтобы упростить этот процесс, можно создать экземпляр `HTTPBasicAuthHandler` и opener для использования этого обработчика.340341`HTTPBasicAuthHandler` использует объект, называемый менеджером паролей, для управления сопоставлением URL и областей (realm) с паролями и именами пользователей. Если известно, что представляет собой область (из заголовка аутентификации, отправленного сервером), то можно использовать `HTTPPasswordMgr`. Часто область не имеет значения. В таком случае удобно использовать `HTTPPasswordMgrWithDefaultRealm`. Это позволяет указать имя пользователя и пароль по умолчанию для URL. Они будут использоваться при отсутствии альтернативной комбинации для конкретной области. Для этого нужно передать `None` в качестве аргумента realm методу `add_password`.342343URL верхнего уровня – это первый URL, требующий аутентификации. URL «глубже», чем переданный в .add\_password(), также будут соответствовать.344345```python346# создать менеджер паролей347password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()348349# Добавить имя пользователя и пароль.350# Если бы мы знали realm, мы могли бы использовать его вместо None.351top_level_url = "http://example.com/foo/"352password_mgr.add_password(None, top_level_url, username, password)353354handler = urllib.request.HTTPBasicAuthHandler(password_mgr)355356# создать "opener" (экземпляр OpenerDirector)357opener = urllib.request.build_opener(handler)358359# использовать opener для получения URL360opener.open(a_url)361362# Установить opener.363# Теперь все вызовы urllib.request.urlopen будут использовать наш opener.364urllib.request.install_opener(opener)365```366367> **Примечание**368>369> В приведенном выше примере мы передали только `HTTPBasicAuthHandler` в `build_opener`. По умолчанию открыватели содержат обработчики для обычных ситуаций: `ProxyHandler`, `UnknownHandler`, `HTTPHandler`, `HTTPDefaultErrorHandler`, `HTTPRedirectHandler`, `FTPHandler`, `FileHandler`, `HTTPErrorProcessor`.370371`top_level_url` на самом деле *может быть* полным URL (включая схему 'http:' и имя хоста, а также, опционально, номер порта), например, “[http://example.com/](https://python-all.ru/3.2/howto/urllib2.html)” *или* «authority» (т.е. имя хоста, опционально включая номер порта), например, “example.com” или “example.com:8080” (последний пример включает номер порта). Authority, если присутствует, не должен содержать компонент «userinfo» – например, “joe@password:example.com” неверен.372373## Прокси374375**urllib** автоматически определит настройки прокси и будет их использовать. Это происходит через `ProxyHandler`, который является частью обычной цепочки обработчиков. Обычно это хорошо, но бывают случаи, когда это может быть нежелательно [\[6\]](https://python-all.ru/3.2/howto/urllib2.html#id14). Один из способов – настроить собственный `ProxyHandler` без определения прокси. Это делается с помощью шагов, аналогичных настройке обработчика [Basic Authentication](https://python-all.ru/3.2/howto/urllib2.html):376377```python378>>> proxy_support = urllib.request.ProxyHandler({})379>>> opener = urllib.request.build_opener(proxy_support)380>>> urllib.request.install_opener(opener)381```382383> **Примечание**384>385> В настоящее время `urllib.request` *не поддерживает* получение `https`-ресурсов через прокси. Однако эту возможность можно включить, расширив urllib.request, как показано в рецепте [\[7\]](https://python-all.ru/3.2/howto/urllib2.html#id15).386387## Сокеты и уровни388389Поддержка Python для получения ресурсов из сети является многоуровневой. urllib использует библиотеку [`http.client`](https://python-all.ru/3.2/library/http.client.html#module-http.client), которая, в свою очередь, использует библиотеку socket.390391Начиная с Python 2.3 можно указать, как долго сокет должен ждать ответа до истечения тайм-аута. Это может быть полезно в приложениях, которым приходится получать веб-страницы. По умолчанию модуль socket не имеет *тайм-аута* и может зависнуть. В настоящее время тайм-аут сокета не доступен на уровнях http.client или urllib.request. Однако можно установить глобальный тайм-аут по умолчанию для всех сокетов с помощью392393```python394import socket395import urllib.request396397# тайм-аут в секундах398timeout = 10399socket.setdefaulttimeout(timeout)400401# этот вызов urllib.request.urlopen теперь использует тайм-аут по умолчанию402# который мы установили в модуле socket403req = urllib.request.Request('http://www.voidspace.org.uk')404response = urllib.request.urlopen(req)405```406407---408409## Примечания410411Этот документ был проверен и доработан Джоном Ли.412413| [\[1\]](https://python-all.ru/3.2/howto/urllib2.html#id1) | Введение в протокол CGI см. в [Writing Web Applications in Python](https://python-all.ru/3.2/howto/urllib2.html). |414| --- | --- |415416| [\[2\]](https://python-all.ru/3.2/howto/urllib2.html#id2) | Например, Google. *Правильный* способ использовать Google из программы – это, конечно, использовать [PyGoogle](https://python-all.ru/3.2/howto/urllib2.html). См. [Voidspace Google](https://python-all.ru/3.2/howto/urllib2.html) для примеров использования Google API. |417| --- | --- |418419| [\[3\]](https://python-all.ru/3.2/howto/urllib2.html#id3) | Определение браузера (browser sniffing) – очень плохая практика при проектировании веб-сайтов; гораздо разумнее создавать сайты с использованием веб-стандартов. К сожалению, многие сайты до сих пор отправляют разные версии разным браузерам. |420| --- | --- |421422| [\[4\]](https://python-all.ru/3.2/howto/urllib2.html#id4) | Пользовательский агент для MSIE 6 – *'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)'* |423| --- | --- |424425| [\[5\]](https://python-all.ru/3.2/howto/urllib2.html#id5) | Подробнее о HTTP-заголовках запросов см. [Quick Reference to HTTP Headers](https://python-all.ru/3.2/howto/urllib2.html). |426| --- | --- |427428| [\[6\]](https://python-all.ru/3.2/howto/urllib2.html#id7) | В моём случае на работе приходится использовать прокси для доступа в интернет. Если через этот прокси пытаться получить *localhost*-URL, он их блокирует. В IE настроено использование прокси, и urllib это подхватывает. Чтобы тестировать скрипты с локальным сервером, приходится запрещать urllib использовать прокси. |429| --- | --- |430431| [\[7\]](https://python-all.ru/3.2/howto/urllib2.html#id8) | Открыватель urllib для SSL-прокси (метод CONNECT): [ASPN Cookbook Recipe](https://python-all.ru/3.2/howto/urllib2.html). |432| --- | --- |433