[Question] How to get in console.log a specific text message, from console within devtools
See original GitHub issueHi, I am trying to get specific text message to appear in console.log, which existed in console within devtool (when i add “&debug=true” at the end of url), i am trying following but msg.args prints out all kind of messages. is there a better way to handle\streamline the args?
const page = await browser.newPage(); await page.goto(‘URL&debug=true’);
page.on(‘console’, msg => {
for (let i = 0; i < msg.args().length; ++i)
console.log(${i}: ${msg.args()[i]});
});
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to log messages in the Console | DevTools Tips - YouTube
In this episode, Bramus and Jecelyn walk you through the different ways of logging and filtering messages in the Console.
Read more >Log messages in the Console - Chrome Developers
Focus the demo and then press Control + Shift + J or Command + Option + J (Mac) to open DevTools. By default...
Read more >How to read from Chrome's console in JavaScript
What's in the console can't be read from JavaScript. What you can do is hook the console.log function so that you store when...
Read more >How to Style console.log Contents in Chrome DevTools
Learn how the console. log output can be styled in DevTools using the CSS format specifier. We'll also touch on manipulating console.
Read more >Copy JSON from console.log in developer tool to clipboard?
@EdwinSnts Bertrand means in the Javascript console, after logging an object with console.log( myObject ) , to right click on that object. It...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ll complement this with a snippet:
console.log(42, 'hello', true);etc.