urllib.request — Extensible library for opening URLs — Python 3.14.7 documentation

docs.python.org

Tin mới

urllib — URL handling modules

urllib.parse — Parse URLs into components

Python Module Index

3.14.7 Documentation

The Python Standard Library

Internet Protocols and Support

WebAssembly platforms

This module does not work or is not available on WebAssembly. See WebAssembly platforms for more information.

http.client.HTTPSConnection

Open url, which can be either a string containing a valid, properly encoded URL, or a Request object.

urllib.error.URLError

Open url, which can be either a string containing a valid, properly encoded URL, or a Request object.

set_alpn_protocols()

Changed in version 3.10: HTTPS connection now send an ALPN extension with protocol indicator http/1.1 when no context is given. Custom context should set ALPN protocols with set_alpn_protocols().

socket.gethostbyname()

Convert the given file: URL to a local path. This function uses unquote() to decode the URL.

http.cookiejar.CookieJar

The http.cookiejar.CookieJar in which cookies are stored.

email.message.Message

Handle an authentication request by getting a user/password pair, and re-trying the request. authreq should be the name of the header where the information about the realm is included in the request, host specifies the U

wsgiref.headers.Headers

Handle an authentication request by getting a user/password pair, and re-trying the request. authreq should be the name of the header where the information about the realm is included in the request, host specifies the U

HOWTO Fetch Internet Resources Using The urllib Package

In addition to the examples below, more examples are given in HOWTO Fetch Internet Resources Using The urllib Package.

html.parser: A simple parser that can handle HTML and XHTML.

The data returned by urlopen() or urlretrieve() is the raw data returned by the server. This may be binary data (such as an image), plain text or (for example) HTML. The HTTP protocol provides type information in the rep

ftplib: FTP protocol client (requires sockets).

email.message.EmailMessage

Returns the headers of the response in the form of an EmailMessage instance.