学习python获取百度翻译
import requests
url ="https://fanyi.baidu.com/sug" # 英文转中文
e = input("请输入英文:")
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0"}#在网络下的虚拟地址
data = {
"kw": e
}
res = requests.post(url, data=data, headers=headers)
res.encoding = 'utf-8'
json = res.json()
for i in json["data"]:
print(e+":"+i['v'])