1062195630 发表于 2021-6-2 11:32:15

55节python

import urllib.request
import 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就好了啊

suchocolate 发表于 2021-6-2 11:42:10

有道设置的反扒

小伤口 发表于 2021-6-2 11:45:56

把URL网址里的_o去掉

Twilight6 发表于 2021-6-2 12:13:26



有道搞的小反爬机制,真正的 url 就是去掉 _o 的url

页: [1]
查看完整版本: 55节python