With Puppeteer, listen for the page’s console event and forward each message to Node.js output:
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
Register the listener before navigating or running the action that may log. Headless Chrome does not automatically copy a page’s JavaScript console messages into your terminal: the listener bridges the browser page context and the Node.js automation context.
As an Amazon Associate I earn from qualifying purchases.
Forward page console messages with Puppeteer
This complete example launches headless Chrome, attaches a listener before navigation, and then visits a page. Replace the URL with the page you want to inspect.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
page.on('console', msg => {
console.log('PAGE LOG:', msg.text());
});
await page.goto('https://example.com', { waitUntil: 'load' });
// Perform any actions that may cause additional page console messages here.
} finally {
await browser.close();
}
})();
Run the script with Node.js, for example node capture-console.js. Messages emitted by page JavaScript appear in the terminal with the PAGE LOG: prefix; the prefix helps distinguish them from messages printed by your Node.js code. Puppeteer’s debugging guide demonstrates listening for the console event and forwarding msg.text() to Node output: Puppeteer debugging guide.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Capture messages from a particular action
Install the event listener before the action. This example clicks a button after subscribing, so output triggered by the click can be observed:
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
await page.goto('https://example.com');
await page.click('#run');
Likewise, if page code is executed with page.evaluate(), its browser-side logging can be forwarded by the same listener:
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
await page.evaluate(() => console.log('Message from the page'));
Choose stdout or stderr
console.log() writes the forwarded messages to Node.js stdout. If you want page messages separated from normal output—for example, so shell scripts can redirect them independently—write them to stderr instead:
Free tools Windows power users keep installed
One-click scans. No signup required.
page.on('console', msg => console.error('PAGE LOG:', msg.text()));
This changes where the automation process writes the forwarded message; it does not alter the page’s console behavior.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
When readable text is not enough
msg.text() is a convenient way to print the message text. For richer details such as severity, source, URL, and line or column information, use the metadata exposed by the installed Puppeteer event object or a DevTools Protocol client. The exact fields and bindings can vary with the library and protocol version, so check the documentation for the version in use.
The DevTools Protocol reference marks its legacy Console domain deprecated and points readers toward Runtime or Log. If you are implementing protocol access directly, consult the current reference and the bindings for your protocol version rather than copying an older Console-domain example: Chrome DevTools Protocol reference.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Do not confuse page logs with Chrome diagnostics or output flags
- Page JavaScript console: Subscribe to Puppeteer’s page
consoleevent and forward messages to Node.js. - Chrome diagnostic logging: Chrome’s
--enable-logging --v=1options enable browser diagnostic logs. Those diagnostics are not a dependable substitute for capturing a page’sconsole.log()stream. See Google’s Chrome debug logging documentation. --dump-dom: Prints the page DOM to stdout; it does not subscribe to console events.--print-to-pdfand--screenshot: Create a PDF or screenshot, respectively. They do not print page console messages. See the Headless Chrome guide.- Remote debugging endpoint: With
--remote-debugging-port=0, Chrome writes its selected endpoint to stderr and to theDevToolsActivePortfile in the browser profile folder. That is connection information, not page console output. See the DevTools Protocol documentation.
Troubleshooting missing terminal output
The page logs before the listener is attached
Attach page.on('console', ...) immediately after creating the page and before page.goto(), or before the action that triggers the message. A listener added afterward cannot capture earlier events.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsThe message is from Node.js, not page JavaScript
Node output already goes to the terminal through calls such as console.log(). The Puppeteer listener is for messages produced in the browser page context. Add the listener when you need page-side messages forwarded.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
You are looking at a DOM dump or Chrome log
Switch to the page event listener for website console.* calls. DOM, PDF, screenshot, and Chrome diagnostic options have different purposes and do not replace that event subscription.
Your script exits or closes Chrome too early
Keep the browser open until the navigation and any actions of interest have completed. In asynchronous scripts, await those operations before closing the browser; otherwise there may be no opportunity to receive later events.
Protocol fields differ from an example
Check the installed Puppeteer version or the current DevTools Protocol documentation. The protocol reference is living documentation, and its legacy Console domain is deprecated.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteOr skip the browser setup
If you need screenshots or PDFs rather than a terminal stream of JavaScript console messages, ScreenshotNeo provides a one-request capture API. This does not replace console-event forwarding; it is an alternative for capture output.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo documentation for API options. Before a capture, it accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo to get 1,000 screenshots a month free, with no card required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →




