Question

If you know about OnBeforeResponse then you know what I am trying to do.

How can I make it paste the URL in excel file instead of opening each and every URL in chrome or Firefox

from

  if(oSession.url.Contains(".mp3")){
            FiddlerApplication.Log.LogFormat("downloading "+oSession.url);
            System.Diagnostics.Process.Start("chrome.exe",oSession.url);
        }

what I tried so far.

 if(oSession.url.Contains(".mp3")){
            FiddlerApplication.Log.LogFormat("downloading "+oSession.url);
            System.Diagnostics.Process.Start("excel.exe",oSession.url);
        }

I am also trying to use cmd.exe to output each oSession.url to > somefile.txt.

Was it helpful?

Solution

I am also trying cmd.exe output each oSession.url to > somefile.txt.

If you are merely trying to scrape the MP3 urls into a file for some later use, then the idea of outputting them to somefile.txt seems simpler than trying to interact with Excel from FiddlerScript.

Add the following line (to your code), which accomplishes appending the latest MP3 url to somefile.txt (note: I placed my text file in a particular folder):

System.Diagnostics.Process.Start("cmd.exe", "/c echo " + oSession.url + " >> c:\\temp\\somefile.txt") 

The file will accumulate the MP3 urls as you click. Hope that helps.

OTHER TIPS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top