帮看一下错误的原因,谢谢
importurllib.request as simport urllib.parse
url="http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule&smartresult=ugc&sessionFrom=http://www.youdao.com/"
data={}
data['type']='AUTO'
data['i']='I love FishC.com!'
data['doctype']='json'
data['xmlVersion']='1.6'
data['keyfrom']='fanyi.web'
data['ue']='UTF-8'
data['typoResult']='true'
data=urllib.parse.urlencode(data).encode('utf-8')
response=s.urlopen(url,data)
html=response.read().decode('utf-8')
print(html) importurllib.request as s
import urllib.parse
url="http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule&smartresult=ugc&sessionFrom=http://www.youdao.com/"
data = {
'from':'AUTO',
'to':'AUTO',
'smartresult':'dict',
'client':'fanyideskweb',
'salt':'1500092479607',
'sign':'c98235a85b213d482b8e65f6b1065e26',
'doctype':'json',
'version':'2.1',
'keyfrom':'fanyi.web',
'action':'FY_BY_CL1CKBUTTON',
'typoResult':'true'}
data=urllib.parse.urlencode(data).encode('utf-8')
response=s.urlopen(url,data)
html=response.read().decode('utf-8')
print(html)
ba21 发表于 2017-9-8 21:39
谢了,已经解决,
页:
[1]