Yes—you can often capture the page after Puppeteer times out. Catch the failed navigation or wait, keep using the same page object, and then try to save its current URL, title, HTML, and screenshot. A timeout means the operation did not meet its wait condition in time; it does not by itself mean the page or browser has become unusable. Handle capture errors separately so a second failure does not hide the original timeout.
Capture the page after the timeout
Put the operation that may time out in its own try/catch. Once caught, query and capture the same Puppeteer Page instance. The example records the navigation error, final URL, title, and HTML, then saves a full-page screenshot:
let navigationError;
try {
await page.goto(targetUrl, {
waitUntil: 'domcontentloaded',
timeout: 15_000,
});
} catch (error) {
navigationError = error;
}
const snapshot = {
error: navigationError?.message ?? null,
url: page.url(),
title: await page.title(),
html: await page.content(),
};
await page.screenshot({
path: 'puppeteer-timeout.png',
fullPage: true,
});
page.content() returns the page’s full HTML contents, including the DOCTYPE, according to the Puppeteer API documentation. page.screenshot() captures the page; the official guide demonstrates saving to a file with the path option. These calls are separate operations and should be protected too: a page that remains available after a navigation timeout can still encounter an error while its content is read or screenshot is taken.
Keep the original error and any capture error
If the screenshot fails, record that failure without replacing the navigation timeout. Likewise, if reading the HTML fails, it should not prevent an attempt to save the screenshot. A small helper lets each capture step fail independently:
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
- AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
- ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
- AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
- STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth
const errors = [];
let navigationError;
try {
await page.goto(targetUrl, {
waitUntil: 'domcontentloaded',
timeout: 15_000,
});
} catch (error) {
navigationError = error;
errors.push({ step: 'navigation', message: error.message });
}
const result = {
navigationError: navigationError?.message ?? null,
url: null,
title: null,
html: null,
screenshot: 'puppeteer-timeout.png',
captureErrors: errors,
};
for (const [step, capture] of [
['url', () => page.url()],
['title', () => page.title()],
['html', () => page.content()],
]) {
try {
result[step] = await capture();
} catch (error) {
errors.push({ step, message: error.message });
}
}
try {
await page.screenshot({ path: result.screenshot, fullPage: true });
} catch (error) {
errors.push({ step: 'screenshot', message: error.message });
}
The code attempts each artifact independently and leaves the navigation failure available for diagnosis. If the script manages the browser, close it in a finally block, after the capture attempts.
A complete runnable Node.js example
Install Puppeteer in a Node.js project with npm install puppeteer, then save this as capture-after-timeout.js. Run it with a URL argument, for example node capture-after-timeout.js https://example.com. Puppeteer may download a compatible browser during installation; use the installation method appropriate to your environment if that download is managed separately.
const fs = require('node:fs/promises');
const puppeteer = require('puppeteer');
async function main() {
const targetUrl = process.argv[2];
if (!targetUrl) {
throw new Error('Usage: node capture-after-timeout.js <url>');
}
const browser = await puppeteer.launch({ headless: true });
let page;
try {
page = await browser.newPage();
let navigationError = null;
try {
await page.goto(targetUrl, {
waitUntil: 'domcontentloaded',
timeout: 15_000,
});
} catch (error) {
navigationError = {
message: error.message,
stack: error.stack ?? null,
};
console.error('Navigation did not complete:', error.message);
}
const record = {
navigationError,
url: null,
title: null,
htmlFile: 'puppeteer-timeout.html',
screenshotFile: 'puppeteer-timeout.png',
captureErrors: [],
};
try {
record.url = page.url();
} catch (error) {
record.captureErrors.push({ step: 'url', message: error.message });
}
try {
record.title = await page.title();
} catch (error) {
record.captureErrors.push({ step: 'title', message: error.message });
}
try {
const html = await page.content();
await fs.writeFile(record.htmlFile, html, 'utf8');
} catch (error) {
record.captureErrors.push({ step: 'html', message: error.message });
}
try {
await page.screenshot({
path: record.screenshotFile,
fullPage: true,
});
} catch (error) {
record.captureErrors.push({ step: 'screenshot', message: error.message });
}
await fs.writeFile('puppeteer-timeout.json', JSON.stringify(record, null, 2));
console.log(JSON.stringify(record, null, 2));
} finally {
await browser.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
On a successful run, the script writes puppeteer-timeout.html, puppeteer-timeout.png, and puppeteer-timeout.json in the current directory. If navigation timed out but the page remained usable, the JSON records the final URL and title along with the original error. A failed capture is listed in captureErrors; it does not erase the navigation error. A launch failure or other error outside the guarded capture steps reaches the outer handler, and the browser is still closed by finally.
Choose the artifact that answers your debugging question
| Artifact | Best for | What it preserves | Trade-off |
|---|---|---|---|
| Screenshot | Checking what a person would have seen | The rendered visual appearance at capture time; fullPage: true requests the full scrollable page |
It is not convenient for querying or diffing individual DOM nodes, and a full-page image can be large |
HTML from page.content() |
Inspecting document structure and text | The current DOM serialization, including the DOCTYPE | It does not preserve the rendered pixels or all browser state as a screenshot does |
| URL and title | Identifying which document was reached | The page’s current URL and title, useful alongside a capture when redirects or partial navigation occurred | They do not show the page’s full visual or DOM state |
| Error message and stack | Correlating the artifact with the failed operation | The failure context from the original wait or navigation | They explain the operation’s failure, not what content successfully loaded |
For a useful timeout record, save relevant artifacts together under a stable name or in a per-run directory. Keep the error text with them: a screenshot by itself shows appearance, but not which wait condition failed. Treat captured HTML as potentially sensitive if the page contains user data, tokens, or private content; choose storage and retention accordingly.
Rank #2
- Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
- 14" HD Display: 14.0-inch diagonal, HD (1366 x 768), micro-edge, anti-glare. See your digital world in a whole new way. Enjoy movies and photos with the great image quality and high-definition detail of 1 million pixels.
- Memory & Storage: 4 GB LPDDR4x & 64 GB eMMC Storage. Adequate high-bandwidth RAM to smoothly run multiple applications and browser tabs all at once. An embedded multimedia card provides reliable flash-based storage.
- Ports:2 x USB 3.0 Type-A,1 x USB 3.0 Type-C,1 x HDMI,1 x Headphone Jack
- Chrome OS: Chromebook is a computer for the way the modern world works, with thousands of apps. Enjoy the seamless simplicity that comes with Google Chrome and Android apps, all integrated into one laptop. It’s fast, simple, and secure.
Understand what timed out
A navigation timeout means the selected navigation operation did not satisfy its wait condition within the allotted time. It does not assert that no response arrived, that the document is blank, or that every later call on the Page will fail. The resulting page may be the previous document, a partially loaded destination, or a destination that completed after the wait stopped; inspect page.url(), title, HTML, and screenshot rather than assuming which state you have.
The default navigation timeout can be changed with page.setDefaultNavigationTimeout(). Puppeteer documents that it applies to goBack(), goForward(), goto(), reload(), setContent(), and waitForNavigation(). By contrast, wait methods such as waitForSelector() have a 30-second default and accept timeout: 0 to disable that wait timeout. Use the right control for the operation that actually failed; changing navigation defaults does not fix a selector wait.
Use the least demanding readiness condition that fits
domcontentloadedcan be sufficient when you need the initial document DOM and do not need every asset or later component to finish rendering.- Wait for a specific selector when the capture depends on a known element that appears after the initial document event.
networkidlemay not be suitable on pages that keep requests open. A page with ongoing network activity can make an idle-based wait a poor readiness signal.
For a single slow navigation, set its timeout on that call. Change setDefaultNavigationTimeout() only when the script needs a different navigation limit across operations. Neither approach should be used to conceal a failure that matters to the caller: keep catching and recording the error when a partial capture is still useful.
Prevent a missed navigation after a click
When clicking an element is expected to trigger navigation, start waiting for that navigation before issuing the click. The official Puppeteer Page documentation warns that awaiting click() and then separately calling waitForNavigation() can race with the navigation event. Pair them with Promise.all instead:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
- Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
- AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
- All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
- Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.
const [response] = await Promise.all([
page.waitForNavigation({ waitUntil: 'domcontentloaded' }),
page.click('a.next'),
]);
console.log('Navigation response:', response);
waitForNavigation() waits for a navigation or reload; History API URL changes also count as navigation. If the click or wait rejects, catch the operation and use the same capture approach to inspect the resulting page. The page may have changed even though the wait did not finish as expected.
Or skip the browser setup
If you need a screenshot of a URL rather than the exact browser session already open in your Puppeteer script, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF. Add an access key and the target URL to this cURL example; see the ScreenshotNeo API documentation for request options:
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://stripe.com
-o shot.webp
ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses report the page verdict and billing status in headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf 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’s free plan.
Troubleshoot a missing or unhelpful capture
The timeout was caught, but no screenshot file appeared
Check the recorded captureErrors entry for the screenshot step, then check that the script reached that step and that its output directory is writable. Do not infer that navigation failed to load anything from a missing screenshot; the screenshot operation can fail independently. Keep the original navigation error and screenshot error together.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The saved screenshot or HTML shows the old page
Compare the recorded URL and title with the requested destination. The navigation may not have reached the new document before the wait expired. If the target is a single-page application or renders a key region after the initial document, use a wait that matches that page’s readiness, such as waiting for the relevant selector, then capture again.
Rank #4
- Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
- 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
- Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
- All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
- AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.
The page is incomplete despite a successful wait
A wait condition only establishes that its own condition was met; it is not proof that every page component or image finished loading. Identify the element or state the capture requires and wait for it explicitly. Avoid treating networkidle as universally better: continuously open requests can prevent it from being a useful signal.
The original error disappeared from the logs
Keep navigation and capture in separate try/catch blocks, and store the original message and stack before attempting later calls. If a second failure is allowed to escape first, it can become the only error visible to the caller even though the navigation timeout was the event you intended to diagnose.
A click-triggered navigation sometimes times out intermittently
Register waitForNavigation() in the same Promise.all as the click, with the wait listed first. Calling click() and only afterward starting the navigation wait can miss the event.
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 reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPractical reliability and cost considerations
A local Puppeteer capture uses the browser session and page state your script already has, which is useful when debugging a specific automated run. Save only what you need: a screenshot preserves appearance, while HTML is more useful for structural inspection or later text and DOM analysis. Full-page screenshots and serialized HTML can both grow with page complexity, so consider whether a viewport screenshot is enough before always requesting fullPage: true.
Best Value
- Efficient Intel Processor: Powered by Intel Celeron 5205U dual-core two-thread processor with a fixed 1.9GHz base frequency, 2MB Intel Smart Cache and advanced 14nm Comet Lake lithography. Integrated Intel UHD Graphics for 10th Gen Intel Processors delivers stable daily performance. It handles daily office tasks, web browsing, video streaming and light multitasking smoothly while featuring ultra-low power consumption for extended use.
- Fast Response Large Storage:Equipped with 12GB high-speed RAM to accelerate program loading and enable seamless multitasking. Built-in 256GB solid-state drive provides rapid boot and application launch speeds, offering ample storage space for your documents, software, photos and videos. Run daily productivity and multimedia applications without lag or slowdowns.
- 15.6" FHD IPS Eye-Care Display:This laptop features a 15.6-inch Full HD IPS panel with native 1920×1080 resolution and classic 16:9 widescreen ratio. Designed with slim 5mm ultra-narrow bezels, anti-glare coating and blue light filtering eye protection, it effectively reduces eye strain during long hours of studying, streaming or working, delivering vivid, immersive visual experiences. effectively reduce blue light and eye strain, bringing you immersive visual experience for watching videos and studying.
- Pre‑Installed Windows 11: Ready to Use Comes with a genuine Windows 11 system pre‑loaded, offering a clean, intuitive interface and broad software compatibility. Open the box, power on, and you're all set for school assignments, business reports, or daily computing needs.
- Rich Ports & Long Lasting Battery Life:Built-in 38Wh rechargeable battery and dual stereo speakers. Support Bluetooth 4.2 & 2.4G/5G dual-band WiFi for fast wireless connection. Equipped with Type-C, HDMI, 3.5mm audio jack, dual USB 3.0, Micro TF slot and DC charging port, meet your daily external device connection and office expansion needs.
Increasing a timeout gives a slow operation more time but does not change what success means. Disabling a wait timeout with timeout: 0 can leave a script waiting indefinitely if the condition never occurs. Prefer a specific readiness condition and an explicit finite limit, while preserving partial artifacts when a timeout is useful evidence. If you need repeatable server-side captures from URLs rather than access to the exact existing Puppeteer session, an API may remove browser installation and page-cleanup work; account for the API’s page verdict and billing behavior when diagnosing unsuccessful captures.
Frequently Asked Questions
Does a Puppeteer navigation timeout automatically close the browser?
No. A timeout on the navigation or wait does not, by itself, close the browser. Close a browser you launched in a finally block after attempting the captures.
Can I get the page HTML even if the screenshot fails?
Yes. Protect HTML retrieval and screenshot capture with separate error handlers so one failing artifact does not prevent attempting the other.
Does waitUntil: 'domcontentloaded' mean all page images are ready?
No. It is a document readiness condition, not a guarantee that every image or later-rendered component is ready. Wait for the specific content your capture requires.
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.

