爬虫问题
import urllib.requestimport urllib.parse
url ='http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'
data = {}
data['type'] = 'AUTO'
data['i'] ='i love you'
data['doctype'] = 'json'
data['version'] ='2.1'
data['keyfrom'] = 'fanyi.web'
data['ue'] = 'UTF - 8'
data['typoResult'] = 'false'
data = urllib.parse.urlencode(data).encode('utf - 8')
response = urllib.request.urlopen(url,data)
html = response.read().decode('utf - 8')
print(html)
结果打印出了{"errorCode":50}啥情况? https://fishc.com.cn/forum.php?mod=viewthread&tid=106892&highlight=%7B%2Bquot%3BerrorCode%2Bquot%3B%3A50%7D
页:
[1]