fiddler save files

使用fiddler 保存访问到的文件

使用jscript 

Fiddler Script 是用JScript.NET语言写的

JScript.NET 此语言可以调用C# api

参考地址:http://www.cnblogs.com/tankxiao/archive/2012/04/25/2349049.html#ScriptEditbody

http://stackoverflow.com/questions/21179711/fiddler-script-saveresponsebody

http://improve.dk/using-fiddler-to-automatically-download-streamed-mp3s/

 

static function OnBeforeResponse(oSession: Session) {
if (m_Hide304s && oSession.responseCode == 304) {
oSession["ui-hide"] = "true";
}

if(oSession.responseCode == 200 && oSession.url.Contains("test.apmro.com.cn")){
var url = oSession.url;
if(url.Contains('?')){
url = url.Substring(0,url.LastIndexOf('?'));
}

var path = "C:\\temp\\" +url.Substring(url.IndexOf('/'));
if(!System.IO.File.Exists(path)){
oSession.SaveResponseBody(path);
}



}
}

彩色为添加代码 恩 目录选择C:\\temp\\ 可以保存 其他的应该是权限问题不能保存成功

posted on 2014-04-28 13:22  wensky  阅读(327)  评论(0编辑  收藏  举报

导航