urllib.request.ProxyBasicAuthHandler

class urllib.request.ProxyBasicAuthHandler(password_mgr=None) Handle authentication with the proxy. password_mgr, if given, should be something that is compatible with HTTPPasswordMgr; refer to section HTTPPasswordMgr Objects for information on the interface that must be supported.

urllib.request.ProxyBasicAuthHandler.http_error_407()

ProxyBasicAuthHandler.http_error_407(req, fp, code, msg, hdrs) Retry the request with authentication information, if available.

urllib.request.ProxyDigestAuthHandler

class urllib.request.ProxyDigestAuthHandler(password_mgr=None) Handle authentication with the proxy. password_mgr, if given, should be something that is compatible with HTTPPasswordMgr; refer to section HTTPPasswordMgr Objects for information on the interface that must be supported.

urllib.request.ProxyHandler

class urllib.request.ProxyHandler(proxies=None) Cause requests to go through a proxy. If proxies is given, it must be a dictionary mapping protocol names to URLs of proxies. The default is to read the list of proxies from the environment variables <protocol>_proxy. If no proxy environment variables are set, then in a Windows environment proxy settings are obtained from the registry’s Internet Settings section, and in a Mac OS X environment proxy information is retrieved from the OS X S

urllib.request.OpenerDirector.error()

OpenerDirector.error(proto, *args) Handle an error of the given protocol. This will call the registered error handlers for the given protocol with the given arguments (which are protocol specific). The HTTP protocol is a special case which uses the HTTP response code to determine the specific error handler; refer to the http_error_*() methods of the handler classes. Return values and exceptions raised are the same as those of urlopen().

urllib.request.OpenerDirector.add_handler()

OpenerDirector.add_handler(handler) handler should be an instance of BaseHandler. The following methods are searched, and added to the possible chains (note that HTTP errors are a special case). protocol_open() — signal that the handler knows how to open protocol URLs. http_error_type() — signal that the handler knows how to handle HTTP errors with HTTP error code type. protocol_error() — signal that the handler knows how to handle errors from (non-http) protocol. protocol_request() — si

urllib.request.pathname2url()

urllib.request.pathname2url(path) Convert the pathname path from the local syntax for a path to the form used in the path component of a URL. This does not produce a complete URL. The return value will already be quoted using the quote() function.

urllib.request.OpenerDirector.open()

OpenerDirector.open(url, data=None[, timeout]) Open the given url (which can be a request object or a string), optionally passing the given data. Arguments, return values and exceptions raised are the same as those of urlopen() (which simply calls the open() method on the currently installed global OpenerDirector). The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be use

urllib.request.HTTPRedirectHandler.http_error_307()

HTTPRedirectHandler.http_error_307(req, fp, code, msg, hdrs) The same as http_error_301(), but called for the ‘temporary redirect’ response.

urllib.request.OpenerDirector

class urllib.request.OpenerDirector The OpenerDirector class opens URLs via BaseHandlers chained together. It manages the chaining of handlers, and recovery from errors.