To wait until a launched browser prints a line matching a pattern, use Process.waitForLineOutput(regex, timeout?) from @puppeteer/browsers. It returns a promise for the matching line. If you only want logs printed in Node.js, use Puppeteer’s dumpio option instead; page-level console.log() messages require a separate page event listener.
Wait for a matching browser-process line
The Process class in @puppeteer/browsers documents waitForLineOutput(regex, timeout?), returning Promise<string>. The timeout is optional. The reference pages currently identify the Process class as version 25.12.0 and the method-specific page as version 25.3.0, so check the API for the version installed in your project: method reference and Process class reference.
As an Amazon Associate I earn from qualifying purchases.
import {launch} from '@puppeteer/browsers';
const process = await launch({
// Supply the launch options required by your setup.
});
const matchingLine = await process.waitForLineOutput(/your-pattern/, 30_000);
console.log(matchingLine);
This is an API pattern, not a tested, drop-in launch configuration: provide the arguments your installed version requires and arrange cleanup for the browser process according to your application’s lifecycle. The documented references establish the method signature and return type, but do not specify output buffering or every timeout edge case.
Recommended Free Tools
Choose the right kind of output
“Browser output” can mean several different streams or events. Pick the one that matches what you need to observe:
#1 Best Overall
| Need | Use | What it does |
|---|---|---|
| Wait for output that matches a pattern | Process.waitForLineOutput(regex, timeout?) on an @puppeteer/browsers Process |
Resolves to a string when the method’s matching condition is met. See the method reference. |
| Forward browser executable output into Node’s terminal | dumpio: true in Puppeteer launch options |
Forwards browser stdout and stderr to Node’s corresponding stdout and stderr. The documented default is false. See LaunchOptions. |
| Inspect recent browser output after the fact | getRecentLogs() on the current @puppeteer/browsers Process API |
Returns recent browser stderr and stdout output. See the Process class reference. |
| Capture JavaScript console messages from a page | page.on('console', ...) |
Receives page console events; it is distinct from the browser executable’s stdout and stderr. See the debugging guide. |
| Get the underlying child process from a Puppeteer Browser | browser.process() |
Returns ChildProcess | null; it is null for a browser attached through Puppeteer.connect(). See Browser.process(). |
Forward browser logs to Node.js
For launch failures or crashes where you want to see the executable’s logs in the terminal, set dumpio: true in the Puppeteer launch options. It forwards browser stdout and stderr to Node’s corresponding streams; it does not wait for a matching line or return that line to your code. The documented default is false. The LaunchOptions reference describes dumpio and pipe as different settings: pipe configures two additional stdio streams for browser automation instead of WebSocket.
Capture console messages from page JavaScript
Code running inside the page does not directly print its console.log() messages to Node.js. Subscribe to the page’s console event instead:
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
page.on('console', message => {
console.log('Page console:', message.text());
});
This observes page console messages, not browser-process output. The Puppeteer debugging guide documents the distinction.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Know the boundary between launched and connected browsers
Browser.process() exposes a local ChildProcess or null. When Puppeteer attaches to an existing browser with Puppeteer.connect(), the documented result is null; there is no local child process available through that method. This API is not documented as interchangeable with the @puppeteer/browsers Process class used by waitForLineOutput(). See the Browser.process() reference.
Rank #3
Troubleshooting
The code logs nothing while the browser runs
Confirm whether you need a matching process line, terminal forwarding, or page console events. Use waitForLineOutput() for a matching line, dumpio: true for forwarded executable logs, or page.on('console', ...) for page JavaScript. These mechanisms observe different output.
browser.process() returns null
This is the documented result when the browser was attached with Puppeteer.connect(). That method does not provide a local child process in this case; it is not a substitute for a launched @puppeteer/browsers Process.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
The method, timeout, or matching behavior differs from expectations
Check the documentation corresponding to the exact installed package version. The method-specific reference reviewed is version 25.3.0, while the current Process class reference is version 25.12.0. Those references do not establish output-buffering, line-matching details, or all timeout behavior, so avoid depending on undocumented semantics.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsThe browser fails to launch or crashes
Enable dumpio: true to forward browser stdout and stderr into Node’s streams, as recommended in Puppeteer’s debugging guide. If using the @puppeteer/browsers Process API, getRecentLogs() is also documented for reading recent browser output.
Best Value
Or skip the browser setup
If your goal is a website screenshot rather than observing browser-process output, ScreenshotNeo returns a screenshot or PDF with one GET request. Its screenshot capture can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before taking the shot; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf.
Example request (see the ScreenshotNeo API documentation):
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free and get 1,000 screenshots a month with no card.
Frequently Asked Questions
Does dumpio wait for a particular line?
No. It forwards browser stdout and stderr to Node’s corresponding streams; use waitForLineOutput() when you need a promise for matching process output.
Will page.on('console') capture browser startup logs?
No. It receives console events from page JavaScript. Browser executable logs are a separate output channel.
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.




