|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 Wayne11 于 2020-3-18 10:09 编辑
python爬虫54讲C:\Users\DELL\Desktop postdata 我的是这样和小甲鱼的完全不一样
i: I am Mike
from: AUTO
to: AUTO
smartresult: dict
client: fanyideskweb
salt: 15844940600255
sign: 72befd0b2b02fcf9f802c6f5f1758bcc
ts: 1584494060025
bv: e218a051a7336600dfed880d272c7d6f
doctype: json
version: 2.1
keyfrom: fanyi.web
action: FY_BY_CLICKBUTTION
import urllib.request
url = ' URL: http://fanyi.youdao.com/translat ... mp;smartresult=rule
data = {}
data['i']: 'I am Mike'
data['from']: 'AUTO'
data['to']: 'AUTO'
data['smartresult']: 'dict'
data['client']: 'fanyideskweb'
data['salt']: '15844940600255'
data['sign']: '72befd0b2b02fcf9f802c6f5f1758bcc'
data['ts']: '1584494060025'
data['bv']: 'e218a051a7336600dfed880d272c7d6f'
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)
|
|