login with urllib2

Rafael Durán Castañeda rafadurancastaneda at gmail.com
Sun Aug 14 17:03:14 CEST 2011


I'm not sure but you probably need using HTTPS handler, but without 
exact error code/message...

On 14/08/11 16:50, 守株待兔 wrote:
> please to see my code:
> import urllib
> import urllib2
>
> url = 'http://hi.baidu.com/'
> values = {'username' : '******','password' : '******' }
>
> data = urllib.urlencode(values)
> req = urllib2.Request(url,data)
> response = urllib2.urlopen(req)
> the_page = response.read()
>
> i can't to login ,why?username and password  are  right.
> any word  appreciated.




More information about the Python-list mailing list