I'm looking for a way to get to console.log right from my js script and then search for the string "PlatformID:55564". I want to grab this id 55564 and put it to my script button function. I want to get the total web page console log, not the one that is generated by a script.
I know it's a bad approach to read the console, but I'm particularly interested in this one. I had already grabbed the console to the file, using the example below, but I'm struggling to get the id value from it:
var logBackup = console.log;
var logMessages = [];
console.log = function() {
logMessages.push.apply(logMessages, arguments);
logBackup.apply(console, arguments);
};
I'm particularly interested to fill my id value as a string key here:
params['platformId'] = '55564'; (I suppose the method should apply here, I'm a big beginner in js so I don't know how to search a string and then get a value of it)
Id comes in the console as:
platformId:55564
I need to search for "platformId:" in the console, grab a dynamic value to the right, and put it in my script as:
params['platformId'] = '55564'
Please advice, Regards