import urllib, urllib2, cookielib
username = ''
password = ''
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
login_data=urllib.urlencode({'wc_Login1$txtUsername':username, 'wc_Login1$txtPassword':password})
opener.open('https://www.surveymonkey.com/MyAccount_Login.aspx', login_data)
在这一点上,我得到了以下信息:
^{pr2}$
我相信我使用Opera的蜻蜓正确地将用户名和密码字段标识为wc_Login1$txtUsername和wc_Login1$txtPassword。在
如果我添加以下内容以查看是否正确登录:resp=opener.open('http://www.surveymonkey.com/MySurveys.aspx')
print resp.read()
看来我还停留在登录页面上。在
SurveyMonkey - Log in有什么想法吗?我读过,使用python登录asp页面是一件痛苦的事,但这件事看起来有点直截了当。在