iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To capture lazy-loaded content with Playwright, first trigger the page’s loading behavior—usually by scrolling through it—then wait for the specific content you need to appear and take a full-page screenshot. Setting fullPage: true captures the page’s full scrollable area; it does not itself trigger or guarantee completion of lazy loading. Playwright’s screenshot documentation explains full-page capture, while its Page API documentation recommends checking readiness with assertions rather than treating networkidle as a universal signal.
Why a full-page screenshot can still miss lazy-loaded content
Many pages defer loading images or sections until they approach the visible area. A screenshot with fullPage: true expands the capture to the full scrollable page, but capture extent and content activation are separate steps. Content that was never triggered—or had not finished rendering before capture—can therefore be absent.
The right sequence is to navigate, activate the target page’s loading behavior, verify the content you care about is ready, and then capture the full page. The trigger and readiness check depend on the site.
Capture a lazy-loaded page in Playwright
1. Install Playwright
For a Node.js project, install the Playwright package and its browser binaries:
#1 Best Overall
- Compatible with Nintendo Switch 2’s new GameChat mode
- Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
- Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
- Built-In Mic: The built-in microphone lets others hear you clearly during video calls
- Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
npm init -y
npm install playwright
npx playwright install chromium
2. Scroll the document to trigger loading
Save the following as screenshot.js. Replace the URL, readiness selector, and expected text with values from the page you are capturing. The example scrolls down in viewport-sized steps, recalculates document height as it goes, and then waits for a page-specific element before taking the screenshot.
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
try {
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
// Scroll in steps so viewport-triggered content has an opportunity to load.
await page.evaluate(async () => {
const step = Math.max(200, window.innerHeight);
let y = 0;
let stableHeightChecks = 0;
while (stableHeightChecks < 3) {
const height = document.documentElement.scrollHeight;
if (y >= height) {
stableHeightChecks += 1;
await new Promise(resolve => setTimeout(resolve, 150));
y = document.documentElement.scrollHeight;
continue;
}
stableHeightChecks = 0;
window.scrollTo(0, y);
await new Promise(resolve => setTimeout(resolve, 100));
y += step;
}
window.scrollTo(0, document.documentElement.scrollHeight);
});
// Replace with a selector that indicates the content you actually need is ready.
await page.locator('[data-loaded="true"]').waitFor({ state: 'visible', timeout: 15000 });
await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
await browser.close();
}
})();
Run it with node screenshot.js. The short pauses in the scrolling loop merely give the page a chance to react; they do not prove that a particular component has loaded. The locator wait is the meaningful readiness check, so use a selector tied to the content or completion state that matters on your target page.
Rank #2
- Compatible with Nintendo Switch 2’s new GameChat mode
- Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
- The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
- C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
- The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
3. Choose an appropriate navigation condition
page.goto defaults to waiting for the load event. Playwright also supports domcontentloaded, networkidle, and commit. Use the condition appropriate to the application, but do not assume any navigation event means lazy content is ready. Playwright documents networkidle as no network connections for at least 500 ms and discourages using it as a general test-readiness signal; prefer a web assertion or application-specific state when completeness matters.
Adapt the trigger to the page
Images loaded only near the viewport
Document scrolling is a practical trigger when the page loads images as they approach the viewport. If specific images matter, wait for those images to finish loading before capture. For example, after scrolling, you can check that the relevant image element has completed and has a natural width:
Rank #3
- 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
- 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
- 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
- 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
- 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
await page.locator('img.product-image').evaluate(async img => {
if (!img.complete) {
await new Promise((resolve, reject) => {
img.addEventListener('load', resolve, { once: true });
img.addEventListener('error', reject, { once: true });
});
}
if (img.naturalWidth === 0) throw new Error('Image did not load');
});
Replace img.product-image with the target image selector. A successful load check for one image does not establish that every image on the page is ready.
Nested scrolling regions
Some applications put content in an element with its own scrollbar. Scrolling window will not activate content inside that container. Identify the actual scrolling element and scroll it instead, for example:
Rank #4
- 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
- Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
- Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
- Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
- High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
await page.locator('.results-panel').evaluate(async element => {
const step = Math.max(200, element.clientHeight);
for (let top = 0; top < element.scrollHeight; top += step) {
element.scrollTop = top;
await new Promise(resolve => setTimeout(resolve, 100));
}
element.scrollTop = element.scrollHeight;
});
Use the container’s real selector and pair this with a check for the final item or other expected content.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Virtualized or recycled lists
A virtualized list may render only the items near the current scroll position and recycle their DOM elements as you move. A single full-page screenshot may not contain every logical item, even after scrolling. For these pages, use the application’s own export or pagination mechanism when available, or capture and combine defined sections after verifying each section. Do not assume the full-page option can reconstruct elements the application has removed from the DOM.
Best Value
- Compatible with Nintendo Switch 2’s new GameChat mode
- HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
- Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
- Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
- Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
Choose the right screenshot extent and readiness check
| Need | What to use | Important limitation |
|---|---|---|
| Only the currently visible state | page.screenshot({ path: 'page.png' }) |
Captures the viewport; content farther down is outside the image. |
| The full scrollable document | page.screenshot({ path: 'page.png', fullPage: true }) |
Expands capture extent but does not activate or verify lazy-loaded content. |
| Confidence that a particular section is ready | Wait for a locator, expected text or item count, image readiness, or app-specific completion state | The condition must represent the content relevant to your page and screenshot. |
Troubleshoot missing content
The screenshot stops at the initial viewport or omits lower sections
- Confirm that the screenshot call uses
fullPage: trueif you want the full document. - Check whether the site loads content only when it is near the viewport; if so, scroll before capture.
- Look for a nested scroll container or an application-specific trigger that the document-scrolling loop does not reach.
The section is present but empty, or images are blank
- Replace a generic delay with a locator or application signal that corresponds to the section’s rendered state.
- For important images, check their load status and natural dimensions rather than assuming that an image element’s presence means its asset loaded.
- Make sure the readiness selector identifies the final content, not merely a placeholder that appears before loading completes.
The page keeps changing or the scrolling loop takes too long
- Pages that continuously append content can keep increasing their document height. Set a maximum scroll distance or iteration count appropriate to the target, then verify that the expected final content appeared.
- Do not wait indefinitely for network quiet on pages with polling or persistent connections. Prefer a bounded, page-specific condition.
The script times out waiting for the locator
- Verify the selector against the page’s actual DOM and confirm the expected element is visible in the browser at the time of capture.
- Increase the locator timeout only if the content legitimately needs longer; a longer timeout will not fix a selector that never matches or a trigger that was not activated.
Or skip the browser setup
For a one-request screenshot without maintaining a Playwright browser script, ScreenshotNeo accepts a URL and returns an image or PDF. The API can scroll to load lazy images, wait for a selector or other configured condition, and capture a full page. Its consent-banner, popup, and chat-widget removal steps can each be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report the page verdict and billing status. An MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients. Plans include 1,000 screenshots a month free with no card; paid plans start at $5 for 3,000. See ScreenshotNeo and its API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
Sign up for 1,000 free screenshots a month with no card.
Frequently Asked Questions
Does scrolling guarantee that every lazy-loaded item will appear in the screenshot?
No. Scrolling is a trigger for common viewport-based loading, but the site may require another trigger or use virtualization. Check the content your capture depends on.
Recommended Free Tools
What does Playwright’s `networkidle` condition mean?
The Page API describes it as having no network connections for at least 500 ms. Playwright discourages it as a general test-readiness signal.
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.

