How to login https sever with inputing account name and password?

Karen Wang at
Thu Mar 4 11:38:08 CET 2010

Hi all,

I want to use python to access to https server, like

If open it from IE, will see the pop-up login windows like this 

I tried several ways but always only get page for" HTTP Error 401.2 -
Unauthorized" error. ( myusername and mypassword are all correct)

Below is my code:

import urllib2

values = {

    'user' : "myusername", 

"pass' : "mypassword" }

data = urllib2.urlencode(values)

t = urllib2.urlopen('',data)


where I am wrong ?

Thank you very much.



Best Regards

Karen Wang


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 17890 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list