There is a page where it displays a certain value when you hover over an image. I need to programatically fetch that value from the page. I've got access to the JS console within the page, but cannot figure out where it comes from.
I tried adding breakpoints on DOM changes, but it still unclear where the data came from.
I have also tried dumping the whole window
object but it does not seem to dump out enough data or contain the data (number) that are displayed (censor function taken from Chrome sendrequest error: TypeError: Converting circular structure to JSON)
function censor(censor) {
var i = 0;
return function(key, value) {
if(i !== 0 && typeof(censor) === 'object' && typeof(value) == 'object' && censor == value)
return '[Circular]';
if(i >= 1129)
return '[Unknown]';
++i; // so we know we aren't using the original object anymore
return value;
}
}
for(var key in window){
console.log(key);
if(key === 'frames' || key === 'self' || key === 'window' || key === 'parent' || key === 'top' || key === 'document') continue;
console.log(JSON.stringify(window[key], censor(window[key])))
}
Are there any ideas how I can get a full dump of the data in the page (so I could search where exactly it came from) or get clear trace where the data in the DOM came from? The DOM element is added on image hover, and then removed when mouse is moved away.