alfredhu
(alfredhu)
26
另外有个疑问:为什么股票开盘之后,这个页面刷新后就不是从股价和涨跌幅度就不是从maplocal获取数据呢?此时名称却还是从maplocal获取的
gyan
(Yan)
41
from mitmproxy import http
class MitmXueqiu():
def __init__(self):
self.num = 0
def request(self, flow: http.HTTPFlow) -> None:
if "quote.json" in flow.request.pretty_url and "x=" in flow.request.pretty_url:
with open(r"E:\PycharmProjects\HoseaYanCode\TextRequests\data\temp.json", 'r', encoding="utf-8") as f:
flow.response = http.HTTPResponse.make(
200,
f.read(),
{"Content-Type": "application/json"}
)
addons = [
MitmXueqiu()
]