# https://www.jianshu.com/p/0cf3215c1c3d # pip install PyExecJS # execjs 需要安装nodejs https://nodejs.org/en # url="https://www.qimai.cn/" import requests import execjs def get_analysis(short_url, params): with open("qimai.js",'r',encoding='utf-8') as f: js_html=f.read() js_obj = execjs.compile(js_html) # url = "/index/banner" # params = { # 'cid' : 28 # } analysis = js_obj.call('f1', short_url,params) print(f"analysis={analysis}") return analysis def get_data(app_id): headers = { 'authority': 'api.qimai.cn', 'accept': 'application/json, text/plain, */*', 'accept-language': 'zh-CN,zh;q=0.9', 'cache-control': 'no-cache', 'origin': 'https://www.qimai.cn', 'pragma': 'no-cache', 'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"Windows"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-site', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', } params = { 'appid': app_id, } short_url = "/andapp/detail" url = f"https://api.qimai.cn{short_url}" analysis=get_analysis(short_url,params) params["analysis"]=analysis response = requests.get(url, params=params, headers=headers) print(response.json()) if __name__ == '__main__': app_id="100626" get_data(app_id)
运行结果:
需要js代码的可以加微信私聊:xieake1905
标签:逆向,get,url,七麦,analysis,js,sec,params From: https://www.cnblogs.com/knighterrant/p/18030287