FAQ
I get this error:

HTTP Error 401: Authorization Required

When I do this:

try:
handler = urllib2.HTTPBasicAuthHandler()
handler.add_password('realm', 'website', 'user', 'pass')
opener = urllib2.build_opener(handler)
urllib2.install_opener(opener)
f = urllib2.urlopen('http://website')
print f.read()
f.close()
except Exception, e:
print e

I have the right username and password. I may be using the above code
wrong. Any tips?

Thanks,
Brad

Search Discussions

  • Rtilley at Feb 20, 2006 at 11:38 pm

    rtilley wrote:
    I have the right username and password. I may be using the above code
    wrong. Any tips?
    I had the _wrong_ password... Sorry.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 20, '06 at 11:32p
activeFeb 20, '06 at 11:38p
posts2
users1
websitepython.org

1 user in discussion

Rtilley: 2 posts

People

Translate

site design / logo © 2018 Grokbase