55节python
import urllib.requestimport urllib.parse
url='https://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'
data={}
data['i']='i love fishc'
data['from']='AUTO'
data['to']='AUTO'
data['smartresult']='dict'
data['client']='fanyideskweb'
data['salt']='16226039662122'
data['sign']='d0779643c3cfcf8ac7a628ab6e06b719'
data['lts']='1622603966212'
data['bv']='eff2e73dc527a143fb4d0a678a264090'
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}
为什么去掉url中的_0就好了啊 有道设置的反扒 把URL网址里的_o去掉
有道搞的小反爬机制,真正的 url 就是去掉 _o 的url
页:
[1]