Login using usrllib2

dudeja.rajat at gmail.com dudeja.rajat at gmail.com
Wed Dec 1 04:53:59 EST 2010


Hi All,


I'm using urllib2 module to login to an https server. However I'm unable to
login as the password is not getting accepted.

Here is the code:

import urllib2, urllib
values={'Username': 'admin', 'Password': 'admin123'}
url='https://172.25.17.20:9443'
data = urllib.urlencode(values)


data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
the_page = response.read()
print the_page

The error message I get in the_page output is the same as I get when I
access this site using a browser and supply a wrong password. It appears
password is not accepting.

I'm new to web programming. The aim is to automate user clicks on a web
server which can be replicated using python and http. Please suggest / help.


Regards,
Rajat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101201/092888e8/attachment.html>


More information about the Python-list mailing list