password authentication to handle requests involving password authenticationyou create an opener with some combination of httpbasicauthhandlerhttpdigestauthhandlerproxybasicauthhandleror proxydigestauthhandler handlers added to it each of these handlers has the following method which can be used to set passwordh add_password(realmuriuserpasswdadds user and password information for given realm and uri all parameters are strings uri can optionally be sequence of urisin which case the user and password information is applied to all the uris in the sequence the realm is name or description associated with the authentication its value depends on the remote server howeverit' usually common name associated with collection of related web pages uri is base url associated with the authentication typical values for realm and uri might be something like ('administrator''and password specify username and passwordrespectively here is an example of how to set up an opener with basic authenticationauth httpbasicauthhandler(auth add_password("administrator","create opener with authentication added opener build_opener(authopen url opener open("http cookies to manage http cookiescreate an opener object with an httpcookieprocessor handler added to it for examplecookiehand httpcookieprocessor(opener build_opener(cookiehandu opener open("by defaultthe httpcookieprocessor uses the cookiejar object found in the http cookiejar module different types of cookie processing can be supported by supplying different cookiejar object as an argument to httpcookieprocessor for examplecookiehand httpcookieprocessorhttp cookiejar mozillacookiejar("cookies txt"opener build_opener(cookiehandu opener open("proxies if requests need to be redirected through proxycreate an instance of proxyhandler proxyhandler([proxies]creates proxy handler that routes requests through proxy the argument proxies is dictionary that maps protocol names (for example'http''ftp'and so onto the urls of the corresponding proxy server lib fl ff