|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
各位大神,帮我看看这个代码,是有道词典的,他返回错误{"errorCode":50}
- url = 'http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule&sessionFrom=dict2.index'
- data = {}
- data['i'] = 'it is a turkey'
- data['from'] = 'AUTO'
- data['to'] = 'AUTO'
- data['smartresult'] = 'dict'
- data['client'] = 'fanyideskweb'
- data['salt'] = '1499223456651'
- data['sign'] = 'b687c44aa0403419fc51e8d5344c296e'
- data['doctype'] = 'json'
- data['version'] = '2.1'
- data['keyfrom'] = 'fanyi.web'
- data['action'] = 'FY_BY_CLICKBUTTON'
- data['typoResult'] = 'true'
- print(data)
- data = urllib.parse.urlencode(data).encode('utf-8')
- response = urllib.request.urlopen(url,data)
- print(2)
- print(response)
- html=response.read().decode('utf-8')
- print(html)
复制代码
|
|