#coding=utf-8
import requests
import json
def translate_zh(word=None):
url = 'http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule'
form_data={"i":word,"from":"AUTO","to":"AUTO","smartresult":"dict","client":"fanyideskweb","salt":"15681728817247","sign":"ff53b6d6556871e099dab2616e646671","ts":"1568172881724","bv":"e2a78ed30c66e16a857c5b6486a1d326","doctype":"json","version":"2.1","keyfrom":"fanyi.web","action":"FY_BY_CLICKBUTTION"}
response = requests.post(url, form_data)
data = json.loads(response.text)
print(data['translateResult'][0][0]['tgt'])
if __name__ == '__main__':
translate_zh('爬虫')