I can login and get the source page properly using requestspackage. Beacause of some reason I can only use the standard library. unfortunately the urlib2 didn't get the same result as request,did I missed some thing?
requests
def login(userName, passWord): url = "https://logindict.youdao.com/login/acc/login" payload = "username=" + userName + "&password=" + passWord + \ "&savelogin=1&app=web&tp=urstoken&cf=7&fr=1&ru=http%3A%2F%2Fdict.youdao.com%2Fwordbook%2Fwordlist%3Fkeyfrom%3Dnull&product=DICT&type=1&um=true" headers = { 'cache-control': "no-cache", 'content-type': "application/x-www-form-urlencoded" } s = requests.session() response = s.post(url, data=payload, headers=headers) print response.text urllib2
url = "https://logindict.youdao.com/login/acc/login" data = 'app=web&tp=urstoken&cf=3&fr=1&ru=http%3A%2F%2Fdict.youdao.com%2Fwordbook%2Fwordlist%3Fkeyfrom%3Dlogin_from_dict2.index&product=DICT&type=1&um=true&username=xxx&password=xxx' headers = { 'cache-control': "no-cache", "Content-Type": "application/x-www-form-urlencoded" } req = urllib2.Request(url, data=value, headers=headers) response = urllib2.urlopen(req) the_page = response.read() print the_page