Here is the code snippet I am working with:
let list: Array<string> =[];
page.on('request', request => list.push('>>', request.method(), request.url()+'\\n'));
page.on('response', response => list.push('<<',String( response.status()), response.url()+'\\n'));
I'm attempting to separate these pushes into individual lines, but haven't been successful so far. My objective is to write these strings in new lines and then save them to a JSON format for that specific view. Alternatively, I could also rebuild the JSON structure to achieve the desired result.
Current output: https://i.sstatic.net/DgorC.png
Desired outcome:
https://i.sstatic.net/gAAjs.png
Would appreciate any assistance you can provide on this matter!