login with urllib2

Ê

ÊØÖê´ýÍÃ

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top