网站:https://login.metu.edu.tr/cas/login
我的代码:
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
urllib2.install_opener(opener)
authentication_url = 'https://login.metu.edu.tr/cas/login'
payload = {
'username':username,
'password':password,
'lt':'A', # this is changing
'execution':'e4s1',
'_eventId':'submit'
}
data = urllib.urlencode(payload)
req = urllib2.Request(authentication_url, data)
resp = urllib2.urlopen(req)
没有错误。只是,我无法登录。问题是什么 ?有什么遗漏?