htaccess & urllib
John J. Lee
jjl at pobox.com
Wed Jul 23 12:28:14 EDT 2003
More information about the Python-list mailing list
Wed Jul 23 12:28:14 EDT 2003
- Previous message (by thread): htaccess & urllib
- Next message (by thread): Getting started with win32pdh...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Max Khesin" <max at cNOvSisiPonAtecMh.com> writes: > Is there a way to access an htaccess-protected directory with urllib, > password being known? urllib2 is better than urllib. >From the urllib2 module docstring, cut down a bit (and assuming you mean basic HTTP authentication -- HTTPDigestAuthHandler might also be of use to you): import urllib2 authinfo = urllib2.HTTPBasicAuthHandler() authinfo.add_password('realm', 'host', 'username', 'password') opener = urllib2.build_opener(authinfo) f = opener.open('http://www.python.org/') print f.info() # response headers print f.read() # response body John
- Previous message (by thread): htaccess & urllib
- Next message (by thread): Getting started with win32pdh...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list