internet application programming custom openers the basic urlopen(function does not provide support for authenticationcookiesor other advanced features of http to add supportyou must create your own custom opener object using the build_opener(functionbuild_opener([handler [handler ]]builds custom opener object for opening urls the arguments handler handler and so on are all instances of special handler objects the purpose of these handlers is to add various capabilities to the resulting opener object the following lists all the available handler objectshandler description cacheftphandler filehandler ftphandler httpbasicauthhandler httpcookieprocessor httpdefaulterrorhandler ftp handler with persistent ftp connections opens local files opens urls via ftp basic http authentication handling processing of http cookies handles http errors by raising an httperror exception http digest authentication handling opens urls via http handles http redirects opens urls via secure http redirects requests through proxy basic proxy authentication digest proxy authentication handler that deals with all unknown urls httpdigestauthhandler httphandler httpredirecthandler httpshandler proxyhandler proxybasicauthhandler proxydigestauthhandler unknownhandler by defaultan opener is always created with the handlers proxyhandlerunknownhandlerhttphandlerhttpshandlerhttpdefaulterrorhandlerhttpredirecthandlerftphandlerfilehandlerand httperrorprocessor these handlers provide basic level of functionality extra handlers supplied as arguments are added to this list howeverif any of the extra handlers are of the same type as the defaultsthey take precedence for exampleif you added an instance of httphandler or some class that derived from httphandlerit would be used instead of the default the object returned by build_opener(has methodopen(url [data [timeout]])that is used to open urls according to all the rules provided by the various handlers the arguments to open(are the same as what are passed to the urlopen(function install_opener(openerinstalls different opener object for use as the global url opener used by urlopen(opener is usually of an opener object created by build_opener(the next few sections show how to create custom openers for some of the more common scenarios that arise when using urlib request module lib fl ff