数据抓取
<div>import urllib.requestimport urllib.parse
url='http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'
data={}
data['action']='FY_BY_CLICKBUTTION'
data['client']='fanyideskweb'
data['doctype']='json'
data['from']='AUTO'
data['i']='who'
data['keyfrom']='fanyi.web'
data['salt']='1524400207311'
data['sign']='e3d748c43dc47fbbf010e3444eba76d7'
data['smartresult']='dict'
data['to']='AUTO'
data['typoResult']='false'
data['version']='2.1'
data=urllib.parse.urlencode(data).encode('utf-8')
req=urllib.request.Request(url,data)
response=urllib.request.urlopen(req)
html=response.read().decode('utf-8')
print(html)</div><div>
</div><div>
</div><div>为什么抓取返回“errorcode”???
</div>
反爬了,换网站练习吧 http://bbs.fishc.com/thread-105393-1-1.html 最新爬虫 http://bbs.fishc.com/forum.php?mod=viewthread&tid=106892&highlight=%D3%D0%B5%C0%B7%AD%D2%EB
页:
[1]