import requests
post_url = 'https://fanyi.baidu.com/sug'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51'}
word = input('输入查询内容:')
data = {'kw': word}
#使用post 请求(和get类似)
response = requests.post(url=post_url, data=data, headers=headers)
#返回值是json类型才能用
dic_obj = response.json()
print(dic_obj)