Re: login with urllib2

2011-08-14 Thread Chris Rebert
2011/8/14 守株待兔 <1248283...@qq.com>: > 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

Re: login with urllib2

2011-08-14 Thread Rafael Durán Castañeda
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(value

login with urllib2

2011-08-14 Thread 守株待兔
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