urllib.request.urlretrieve()

urllib.request.urlretrieve(url, filename=None, reporthook=None, data=None) Copy a network object denoted by a URL to a local file. If the URL points to a local file, the object will not be copied unless filename is supplied. Return a tuple (filename, headers) where filename is the local file name under which the object can be found, and headers is whatever the info() method of the object returned by urlopen() returned (for a remote object). Exceptions are the same as for urlopen(). The secon

urllib.request.URLopener.version

version Variable that specifies the user agent of the opener object. To get urllib to tell servers that it is a particular user agent, set this in a subclass as a class variable or in the constructor before calling the base constructor.

urllib.request.URLopener.retrieve()

retrieve(url, filename=None, reporthook=None, data=None) Retrieves the contents of url and places it in filename. The return value is a tuple consisting of a local filename and either an email.message.Message object containing the response headers (for remote URLs) or None (for local URLs). The caller must then open and read the contents of filename. If filename is not given and the URL refers to a local file, the input filename is returned. If the URL is non-local and filename is not given,

urllib.request.URLopener.open_unknown()

open_unknown(fullurl, data=None) Overridable interface to open unknown URL types.

urllib.request.URLopener.open()

open(fullurl, data=None) Open fullurl using the appropriate protocol. This method sets up cache and proxy information, then calls the appropriate open method with its input arguments. If the scheme is not recognized, open_unknown() is called. The data argument has the same meaning as the data argument of urlopen().

urllib.request.URLopener

class urllib.request.URLopener(proxies=None, **x509) Deprecated since version 3.3. Base class for opening and reading URLs. Unless you need to support opening objects using schemes other than http:, ftp:, or file:, you probably want to use FancyURLopener. By default, the URLopener class sends a User-Agent header of urllib/VVV, where VVV is the urllib version number. Applications can define their own User-Agent header by subclassing URLopener or FancyURLopener and setting the class attribut

urllib.request.urlopen()

urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, capath=None, cadefault=False, context=None) Open the URL url, which can be either a string or a Request object. data must be a bytes object specifying additional data to be sent to the server, or None if no such data is needed. data may also be an iterable object and in that case Content-Length value must be specified in the headers. Currently HTTP requests are the only ones that use data; the HTTP request will be a POST inste

urllib.request.urlcleanup()

urllib.request.urlcleanup() Cleans up temporary files that may have been left behind by previous calls to urlretrieve().

urllib.request.url2pathname()

urllib.request.url2pathname(path) Convert the path component path from a percent-encoded URL to the local syntax for a path. This does not accept a complete URL. This function uses unquote() to decode path.

urllib.request.UnknownHandler.unknown_open()

UnknownHandler.unknown_open() Raise a URLError exception.