Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #11393 > unrolled thread
| Started by | "守株待兔" <1248283536@qq.com> |
|---|---|
| First post | 2011-08-14 22:50 +0800 |
| Last post | 2011-08-14 22:50 +0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
login with urllib2 "守株待兔" <1248283536@qq.com> - 2011-08-14 22:50 +0800
| From | "守株待兔" <1248283536@qq.com> |
|---|---|
| Date | 2011-08-14 22:50 +0800 |
| Subject | login with urllib2 |
| Message-ID | <mailman.2272.1313333426.1164.python-list@python.org> |
[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 top | Article view | comp.lang.python
csiph-web