当遇到这个错误的时候,解决办法是:
headers = {
"Host":"fanyi.youdao.com",
"Connection":"keep-alive",
"Content-Length":"201",
"Accept":"application/json, text/javascript, */*; q=0.01",
"Origin":"http://fanyi.youdao.com",
"X-Requested-With":"XMLHttpRequest",
"User-Agent":'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0',
"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",
"Referer":"http://fanyi.youdao.com/",
# "Accept-Encoding":"gzip, deflate",
"Accept-Language":"zh-CN,zh;q=0.9",
"Cookie":"fanyi-ad-id=46607; fanyi-ad-closed=1; OUTFOX_SEARCH_USER_ID=518495945@10.168.8.61; OUTFOX_SEARCH_USER_ID_NCOO=864597530.4941442; JSESSIONID=aaa8f-DvDX97p-CzgE7qw; ___rl__test__cookies=1530014068222",
}
需要把头部信息中的关于gzip压缩的给注释掉就可以了