过滤响应内容非json的接口录制
This commit is contained in:
parent
e6e5db3ddb
commit
aa09f3a945
|
@ -52,5 +52,5 @@ class ReadFile:
|
|||
if table.cell_value(norw, 4) != '否': # 每行第4列等于否将不读取内容
|
||||
value = table.row_values(norw)
|
||||
value.pop(4)
|
||||
data_list.append(list(value))
|
||||
data_list.append(value)
|
||||
return data_list
|
||||
|
|
|
@ -48,11 +48,11 @@ class Counter:
|
|||
|
||||
def response(self, flow: mitmproxy.http.HTTPFlow):
|
||||
"""
|
||||
mitmproxy抓包处理响应,在这里汇总需要数据
|
||||
mitmproxy抓包处理响应,在这里汇总需要数据, 过滤 包含指定url,并且响应格式是 json的
|
||||
:param flow:
|
||||
:return:
|
||||
"""
|
||||
if self.url in flow.request.url:
|
||||
if self.url in flow.request.url and 'json' in flow.response.headers["Content-Type"]:
|
||||
# 编号
|
||||
number = "C" + str(self.counter)
|
||||
# 标题
|
||||
|
|
Loading…
Reference in New Issue