0

I am a web scraping newbie. I have identified a JS function on a server, whose I/O I need to track. It's an obscured encryption function, and I need to know what values it takes for input and what it outputs. How can I get this done?

So far, I've opened up the web page in firebug, identified where the function is called and then set a breakpoint. However, when I refresh the page and clear my cache, the browser ignores my breakpoint and loads the page as if there were no breakpoints on it.

user1801060
  • 2,733
  • 6
  • 25
  • 44

1 Answers1

0

You can use console.log in your function to load data to console. But it's better to use it any debug state:

if (app.debug) {
   console.log(data)
}

Where app for example is your namespace, debug is flag for logging and data is your function/application data.

More info about console.

About clear cache: Firebug and Chrome Dev Tools remove all breakpoints from file if file was changed.

Alex
  • 11,115
  • 12
  • 51
  • 64
  • I am a bit confused when you mention namespace. The page I'm working on is'nt mine. All I have is a listing of several functions whose call order I managed to discover. However, I cant figure what value is being passed into the function. – user1801060 Nov 21 '13 at 09:49
  • Can you add any code to the function? Do you have access to the function? – Alex Nov 21 '13 at 10:23
  • No I cant add any console functions to it. A similar question to mine can be found here: http://stackoverflow.com/questions/4921966/live-javascript-debugging-by-recording-function-calls-and-parameters – user1801060 Nov 21 '13 at 10:30
  • 1
    Yes, it will help you. – Alex Nov 21 '13 at 10:32