[Tutor] Using urllib to retrieve info
davholla2002 at yahoo.co.uk
Tue Aug 9 15:53:17 CEST 2005
I had a look at urllib2 and I found this example :-
# Create an OpenerDirector with support for Basic HTTP
auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password('realm', 'host', 'username',
opener = urllib2.build_opener(auth_handler)
# ...and install it globally so it can be used with
One question, what does realm refer to and also what
does it mean by host ?
Thanks in advance.
--- Alan G <alan.gauld at freenet.co.uk> wrote:
> > Sorry of course that is the problem. These pages
> > password protected !!!!
> > Is it possible to download password protected
> pages (I
> > know the password but I don't how to get the
> > to use it).
> That will depend on how the protection is
> If your server is a J2EE box with full blown
> security it may be almost impossible. If it's a more
> conventional server like apache which is protecting
> a file or folder then you may only have to submit
> the username and password - ie login! - or build
> that into a cookie.
> If the protection is done by the application itself
> it could be anywhere in between those two extremes.
> Alan G.
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
More information about the Tutor