Do not rely on page.goto() with waitUntil: 'load' or 'networkidle2' to prove lazy-loaded images are ready. First trigger the images by bringing their page regions into view, then wait for successful image loading and decoding before calling page.screenshot().
Why navigation waits do not guarantee images are ready
A page can finish its load event while images marked for lazy loading remain unfetched: browsers defer those images until they are near the viewport. Puppeteer defines networkidle2 as no more than two network connections for at least 500 ms; that describes network activity, not whether every desired image was requested, loaded successfully, decoded, or painted. For these browser behaviors, see MDN’s img reference and Puppeteer’s lifecycle event documentation.
Puppeteer’s screenshot guide shows navigation and Page.screenshot(), but a page that defers images needs an additional readiness step: Puppeteer screenshot guide.
Wait for images before a full-page screenshot
This example scrolls through successive page regions to trigger viewport-based lazy loading, checks for images that loaded successfully, waits for image decoding, and then captures the full page. It uses a bounded timeout and reports decode failures rather than allowing them to fail silently.
Free tools Windows power users keep installed
One-click scans. No signup required.
#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
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
// Visit successive viewport regions so native lazy loading and
// viewport-triggered page code can request images farther down.
await page.evaluate(async () => {
const step = Math.max(1, window.innerHeight);
const height = document.documentElement.scrollHeight;
for (let y = 0; y < height; y += step) {
window.scrollTo(0, y);
await new Promise(resolve =>
requestAnimationFrame(() => requestAnimationFrame(resolve))
);
}
window.scrollTo(0, 0);
});
// A failed image can still have complete === true, so check naturalWidth.
await page.waitForFunction(
() => [...document.images].every(img => img.complete && img.naturalWidth > 0),
{ timeout: 30000 }
);
// Decode failures (for example, corrupt image data or a changed source)
// are collected so the capture can proceed with an explicit warning.
const decodeFailures = await page.evaluate(async () => {
const images = [...document.images];
const results = await Promise.all(images.map(async (img) => {
try {
await img.decode();
return null;
} catch (error) {
return { src: img.currentSrc || img.src, message: String(error) };
}
}));
return results.filter(Boolean);
});
if (decodeFailures.length) {
console.warn('Some images could not be decoded:', decodeFailures);
}
await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
await browser.close();
}
})();
Replace https://example.com with the page you need. The code follows Puppeteer’s documented wait-function timeout option; its default wait timeout is 30 seconds. If a failed or intentionally optional image should not stop capture, use an explicit failure policy rather than waiting forever. See Puppeteer Page.waitForFunction().
Adapt the wait to what you are capturing
Viewport-only screenshot
For a screenshot of only the visible viewport, waiting on every image in a long document can unnecessarily delay capture or fail because of an unrelated image below the fold. Scope the predicate to images in the target region, or to the images currently relevant to the viewport. A successful image check can use img.complete && img.naturalWidth > 0; then call decode() for those images when decoded image data matters to the capture.
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
Full-page screenshot
fullPage: true extends the screenshot beyond the viewport, but it does not itself visit each region to trigger viewport-proximity loading. Scroll through the page first, then re-query images and run the readiness check. If scrolling or page scripts insert new content, a second pass may be needed because the image set can change after the initial scroll.
Nested scroll containers and observer-driven pages
Some sites load content when a particular element scrolls, not when the window does. The browser’s Intersection Observer API can observe intersections with the viewport or a specified root, and lazy loading is one of its use cases. If the images are inside a nested scroller, move that element through its content instead of only calling window.scrollTo().
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →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.
Check success and decoding, not just completion
HTMLImageElement.complete can be true for a broken image, so pair it with a successful-resource check such as nonzero naturalWidth. MDN documents this distinction in its complete and naturalWidth references.
img.decode() returns a promise that resolves when image data is ready to use. It may reject if the request fails, the source changes during decoding, or the data is corrupt. Decide whether those failures should stop the screenshot, be logged and skipped, or trigger a retry. See MDN’s decode() 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
Troubleshoot missing or delayed images
- The screenshot has blank spaces below the fold:
fullPage: truecaptures the page area but does not necessarily trigger lazy loads. Scroll through the relevant regions before checking readiness. - The wait times out: Identify which image never satisfies the predicate. It may be broken, outside the intended capture, or dynamically inserted after the check begins. Log failed URLs and decide whether to skip, retry, or fail the capture.
- The predicate passes but an image is missing: Check
naturalWidth, not onlycomplete. Then verify the image’scurrentSrc, since responsive markup can select a different resource than expected. - The image is loaded but appears unsettled: Await
decode()for the relevant images and handle rejected promises explicitly. - Scrolling the window has no effect: Find the page’s actual scroll container and move it through its regions. Observer-driven loaders may be rooted to that container.
- Images appear after the capture starts: Page scripts may add or change sources during scrolling. Re-query
document.imagesafter triggering loads and repeat the wait before taking the screenshot.
Or skip the browser setup
ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. Its full-page capture loads lazy images. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed.
For a WebP screenshot, use cURL:
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 API documentation for request options. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Recommended Free Tools
Cost and reliability considerations
Scrolling, waiting, and decoding make the capture more reliable for deferred images, but a page can keep changing or contain genuinely broken resources. Set a timeout, scope checks to the desired content, and define how to handle failures so automation cannot stall indefinitely. For dynamic pages, repeat the image query after scrolling rather than assuming the original set is complete.
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.
Frequently Asked Questions
Does Puppeteer’s networkidle2 wait for lazy-loaded images?
No. It indicates a period with no more than two network connections; it does not prove that offscreen lazy images were requested or decoded.
Does img.complete mean the image loaded successfully?
No. Pair it with a success check such as naturalWidth > 0.
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.

