//代理设置后,手机不能上网的解决方法,还无网的话,手机端安装ssl证书 if (oSession.host.toLowerCase() == "webserver:8888") { oSession.host = "webserver:80"; } //保存请求url if (oSession.uriContains("/aweme/v2/comment/list/") || oSession.uriContains("/aweme/v1/aweme/post/")){ var fso; var file; var curDate = new Date(); fso = new ActiveXObject("Scripting.FileSystemObject"); //文件保存路径,可自定义 file = fso.OpenTextFile("D:\\Sessions.txt",8 ,true, true); file.writeLine(curDate.toLocaleString()); file.writeLine("Request url: " + oSession.url); file.close(); } //保存响应 //过滤无关请求,只关注特定请求 if (oSession.uriContains("/aweme/v2/comment/list/") || oSession.uriContains("/aweme/v1/aweme/post/")) { oSession.utilDecodeResponse();//消除保存的请求可能存在乱码的情况 var fso; var file; var filename = "D:\\Sessions.txt"; fso = new ActiveXObject("Scripting.FileSystemObject"); //文件保存路径,可自定义 file = fso.OpenTextFile(filename,8 ,true, true); file.writeLine("Response code: " + oSession.responseCode); file.writeLine("Response body: " + oSession.GetResponseBodyAsString()); //file.writeLine("\n"); file.close(); }
原文地址:https://www.cnblogs.com/xuanjian-91/p/10348691.html
时间: 2024-10-14 01:59:42