|
|
发表于 2020-2-27 10:01:57
|
显示全部楼层
- import urllib.request as u
- import urllib.parse as r
- url = "http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule"
- date = {}
- date['i'] = 'i love China'
- date['from'] = 'AUTO'
- date['to'] = 'AUTO'
- date['smartresult'] = 'dict'
- date['client'] = 'fanyideskweb'
- date['salt'] = '15827669714235'
- date['sign'] = 'f6cff048e3850965b0feae8c4ce9a930'
- date['ts'] = '1582766971423'
- date['bv'] = '767d6b27f6caf88200654eb2a7b6e2eb'
- date['doctype'] = 'json'
- date['version'] = '2.1'
- date['keyfrom'] = 'fanyi.web'
- date['action'] = 'FY_BY_CLICKBUTTION'
- date['et'] = 'UTF-8'
- date = r.urlencode(date).encode('utf-8')
- response = u.urlopen(url, date)
- html = response.read().decode('utf-8')
- print(html)
复制代码 |
|