求解Python 爬取百度翻译手机版{"errno":997,"from":"zh","to":"en","query":"\u4eba\u751f\u82e6\u77ed"}怎么办

环境:python3.7.3

import requests

url = "https://fanyi.baidu.com/basetrans"
data = {"query": "你好,世界",
    "from": "zh",
    "to": "en"}
headers = {
    "user-agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",
    "referer": "https://fanyi.baidu.com/?aldtype=16047&tpltype=sigma"}
response = requests.post(url,data = data,headers = headers)

print(response.content.decode())

新手,刚开始学习python,运行这个时会显示{“errno”:997,“from”:“zh”,“to”:“en”,“query”:"\u4eba\u751f\u82e6\u77ed"},看了下网上的爬取百度翻译手机版的教程,把他们的代码copy了也会这样,求大佬为我解惑~~~~

你可能感兴趣的:(求解Python 爬取百度翻译手机版{"errno":997,"from":"zh","to":"en","query":"\u4eba\u751f\u82e6\u77ed"}怎么办)