1.分析
有的数据是通过加密解密得到的。
加密:把明文变成密文
解密:把密文变成明文
常见的加密方式:
js加密
css加密
base64加密
尝试一下:
import requests
# url = "http://www.httpbin.org/post"
url = "http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule"
headers = {
'X-Requested-With': 'XMLHttpRequest',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36',
'Origin': 'http://fanyi.youdao.com',
'Referer': 'http://fanyi.youdao.com/',
'Cookie': 'OUTFOX_SEARCH_USER_ID=-1808168645@10.108.160.208; JSESSIONID=aaaRyVJv8oEwg7dPaWrux; OUTFOX_SEARCH_USER_ID_NCOO=704285648.1294403; ___rl__test__cookies=1602406917270'
}
data = {
'action': 'FY_BY_CLICKBUTTION',
'bv': '9caf244986fe6d1de38207408302e500',
'client': 'fanyideskweb',
'doctype': 'json',
'from': 'AUTO',
'i': '你好',
'keyfrom': 'fanyi.web',
'lts': '1602406480004',
'salt': '16024064800043',
'sign': '726a3e12c15fcb8fda7dbd722a80f94b',
'smartresult': 'dict',
'to':