|
发表于 2020-3-20 12:00:27
|
显示全部楼层
import urllib.request
import urllib.parse
url = 'http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'
data = {}
data['i'] = 'hello world'
data['from'] = 'AUTO'
data['to'] = 'AUTO'
data['smartresult'] = 'dict'
data['client'] = 'fanyideskweb'
data['salt'] = '15846749330336'
data['sign'] = 'a41ba02bf4f33a3771b24a9435eeb059'
data['ts'] = '1584674933033'
data['bv'] = '4e11cb72b518906c09c53a926f854eef'
data['doctype'] = 'json'
data['version'] = '2.1'
data['keyfrom'] = 'fanyi.web'
data['action'] = 'FY_BY_CLICKBUTTION'
data = urllib.parse.urlencode(data).encode('utf-8')
response = urllib.request.urlopen(url, data)
html = response.read().decode('utf-8')
print(html)
爬虫第二个爬虫实战 获取结果只显示了 {"errorCode":50}是怎么回事
求助楼主 |
|