Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #11393

login with urllib2

From "守株待兔" <1248283536@qq.com>
Subject login with urllib2
Date 2011-08-14 22:50 +0800
Newsgroups comp.lang.python
Message-ID <mailman.2272.1313333426.1164.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

login  with urllib2 "守株待兔" <1248283536@qq.com> - 2011-08-14 22:50 +0800

csiph-web