Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

How to Capture a Lazy-Loaded Page After Network Idle with Playwright

Network idle does not guarantee lazy content is ready. Scroll the right container, wait for a page-specific signal, then capture the full page.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

networkidle alone cannot tell you that lazy-loaded content is ready. In Playwright, scroll the page or the actual nested feed to trigger loading, wait for a signal tied to the content you need, and only then take a full-page screenshot. You can use networkidle as an optional settling hint, not as proof of completeness.

Why network idle is not enough

Playwright defines networkidle as no network connections for at least 500 ms, but its documentation discourages using that state as a test-readiness condition. Prefer web assertions that verify the outcome you need (Playwright Page API). A page can remain busy because of polling, analytics, or streaming requests; conversely, network traffic can stop before delayed client-side work reveals the content.

As an Amazon Associate I earn from qualifying purchases.

Modern pages may also fetch data lazily and update their interface after the load event, so no single navigation state guarantees that every desired item has appeared (Playwright navigation guide). The reliable sequence is to trigger the relevant lazy loading, then verify the result with a page-specific condition.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a readiness signal that matches the content

Signal Use it for Limit
networkidle An optional brief settling hint after navigation or interaction It does not prove that a target item is visible or that a feed is complete; it may time out on pages with persistent traffic.
A locator or web-first assertion Confirming a target image/card is visible, a loading indicator has disappeared, or a particular item exists You need a selector and condition that reflect the target site’s behavior. Playwright locators auto-wait and retry (Playwright locators).
An application-specific count or completion marker Confirming a known number of items or a site-provided end-of-results signal Only use it if the page exposes a meaningful, trustworthy signal.

Prefer the second or third option when available. A fixed sleep can be useful for a site with known delayed behavior, but by itself it is less reliable than checking the outcome.

#1 Best Overall
Dell Optiplex 3060 Desktop Computer | Intel i5-8500 (3.2) | 32GB DDR4 RAM | 1TB SSD Solid State | Built in WiFi | Bluetooth | Windows 11 Professional | Home or Office PC (Renewed)
  • [INTEL POWERED CONTENT] - Built with a 8th Generation Hexa-Core Intel i5 and 32GB of DDR4 RAM; Modern, Windows 11 ready, with 4K support, Executive multitasking, media streaming and smooth, multi-tab web browsing; Perfect as an all-purpose multimedia computer; built for content creators; Plenty of RAM and Mass storage for photo and video editing powered by Intel HD 630
  • [LATEST WIRELESS TECH] - This Dell Desktop Computer easily connects to the internet through the Built In WiFi / Bluetooth
  • [SOLID STATE STORAGE] - This Dell Computer setup comes with an ultra-fast 1TB Solid State Drive (SSD); Setup as the primary boot device; Boot and load programs with lightning speed ; Additional expansion available
  • [BUY & OWN WITH CONFIDENCE] - From the world's largest Microsoft Authorized Refurbisher; Quality Guarantee and Free Tech Support; Award-winning Customer Service; | Support Sustainable Business
  • [MODERN HI-SPEED PORTS] - USB 3.0 (x4) | USB 2.0 (x4) | DisplayPort (x1) | HDMI Port (x1) | Audio Combo Jack (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)

Scroll the element that actually loads more content

Document-level scrolling

If the browser window owns the scroll position, scroll the document in increments or bring a known bottom element into view. Playwright documents locator scrolling, mouse-wheel input, and page positioning techniques in its scrolling guidance.

Nested feeds and panels

If a feed or panel has its own scrollbar, scroll that element rather than the document. A test ID, role, or other stable locator for the container is preferable to a fragile positional selector. You can update its scrollTop in the page context; re-check its current scrollHeight as content arrives rather than assuming the initial height is final.

Frames

When the content is inside an iframe, locate and interact with the relevant frame. A locator on the main document will not automatically stand in for content owned by a separate frame.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
  • Model: Dell OptiPlex 7050 Small Form Factor (SFF)
  • Processor: Intel Core i7-7700 3.60 GHz
  • Memory: 32GB DDR4 Ram
  • Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
  • Operating System: Windows 11 Pro (64-bit)

Runnable TypeScript example for a nested infinite feed

This pattern uses Playwright Test’s expect. Replace the test IDs and readiness condition with selectors and behavior from the site you are automating. The sample stops when the container has reached its current end without a height change, or after 30 steps; it does not claim to exhaust an unbounded feed.

import { chromium, expect } from '@playwright/test';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });

// Optional settling hint only; persistent network activity is not proof of failure.
try {
  await page.waitForLoadState('networkidle', { timeout: 5_000 });
} catch {
  // Continue using the page-specific checks below.
}

const feed = page.getByTestId('feed'); // Replace with the actual scroll container.
const maxSteps = 30;
let previousHeight = -1;

for (let step = 0; step < maxSteps; step++) {
  const height = await feed.evaluate(el => el.scrollHeight);
  const position = await feed.evaluate(el => el.scrollTop);
  const viewport = await feed.evaluate(el => el.clientHeight);

  if (position + viewport >= height && height === previousHeight) break;
  previousHeight = height;

  await feed.evaluate(el => { el.scrollTop += el.clientHeight; });

  // Replace with a condition tied to the site's loading behavior.
  await expect(page.getByTestId('loading-indicator')).toBeHidden({ timeout: 3_000 });
}

await page.screenshot({ path: 'page.png', fullPage: true });
await browser.close();

The loading-indicator check is illustrative: it is useful only if that indicator reliably represents completion of the batch triggered by the scroll. You might instead check that a known card appears or that the item count increases. If the page scrolls at window level, replace the feed operations with await page.evaluate(() => window.scrollBy(0, window.innerHeight)) or scroll a known bottom locator into view. Playwright page evaluation runs in the page context and can await promises (Playwright page evaluation).

Take a full-page screenshot or make a visual regression assertion

For a one-off image, await page.screenshot({ path: 'page.png', fullPage: true }) captures the full scrollable page (Playwright screenshots). It controls the screenshot extent, not whether lazy content has loaded: perform the scroll-and-check loop first.

Rank #3
Sale
HP All-in-OneDesktop Computer, 16GB DDR5 RAM, Intel Quad-Cores, 128GB SSD, WiFi6, Keyboard & Mouse, Windows 11
  • IMMERSIVE 24 INCH DISPLAY: Experience stunning clarity on a Full HD IPS screen with ultra-thin bezels, offering a 90% screen-to-body ratio that makes everything from spreadsheets to streaming come alive with vibrant colors and crisp details.
  • POWERFUL INTEL PROCESSING: Tackle demanding tasks with ease thanks to the Intel processor and 16GB of high-speed memory, delivering smooth performance whether you're multitasking between applications or running productivity software.
  • GENEROUS STORAGE: Store all your important files, photos, and programs with blazing-fast solid state drive technology that ensures quick boot times, rapid file access, and plenty of space for your digital life.
  • ENHANCED PRIVACY AND COLLABORATION: Work confidently with the pop-up privacy camera that tucks away when not in use, plus dual microphones with noise reduction for crystal-clear video calls that keep you connected professionally.
  • ECO-CONSCIOUS DESIGN: Feel good about your purchase with an EPEAT Gold registered and ENERGY STAR certified computer that combines premium performance with responsible environmental manufacturing practices.

For a Playwright Test visual regression, use await expect(page).toHaveScreenshot() instead of saving a one-off artifact. The screenshot assertion waits for two consecutive screenshots to match before comparing with the expectation (Playwright visual comparisons).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or skip the browser setup

If your goal is an image or PDF rather than Playwright-specific browser interaction, ScreenshotNeo is a website screenshot API and MCP server. For a direct capture, send one GET request (replace the URL as needed):

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners are accepted and removed before capture, along with known newsletter popups and chat widgets; those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server lets AI agents use screenshot and PDF capture tools. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up for 1,000 free screenshots a month, with no card required.

Rank #4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
  • This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high-performance bar may offer Certified Refurbished products on Amazon.com.
  • Dell Optiplex 3050 SFF Desktop computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD
  • Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.
  • Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
  • Support 4K (3840x2160) Dual display, makes it easy to connect two monitors at the same time, and you can expand working Windows, mirror content, or expand a single window across multiple monitors.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

networkidle times out

Persistent network connections may be normal for the site. Catch the timeout if appropriate, then continue only when a relevant locator or application-specific completion condition succeeds. Do not silently treat the timeout—or the absence of one—as proof of completeness.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The screenshot still misses items

Check whether the document or a nested panel owns the scroll position, and confirm that each scroll actually triggers the expected loading behavior. Verify newly loaded content before capturing; fullPage: true cannot trigger it for you.

The script stops too soon or runs indefinitely

A feed that grows as you scroll changes its height dynamically. Re-read the scroll measurements after each batch. For a feed with no natural end, define a target and an explicit maximum number of steps or elapsed time, and treat that bound as part of the result rather than claiming the entire feed was captured.

Best Value
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
  • Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections
  • Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
  • Storage: Combines 500GB SSD and 1TB HDD for ample storage space
  • Graphics: Integrated Intel UHD Graphics 630 for crisp visuals and video playback
  • Design: Sleek desktop tower with black color and slim profile for modern look

The wait condition fails

Confirm that the selector exists on the page and that its state really maps to completion. A hidden loading indicator may not mean that the next card has rendered; a visible target or count change may be a better signal. Adjust the timeout to the site’s behavior rather than relying on a generic delay.

The target is inside an iframe

Use the frame that owns the content and perform the relevant locator checks and scrolling there. Main-page selectors cannot verify content that is not in the main document.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I use waitUntil: 'networkidle' in page.goto()?

You can, but Playwright discourages network idle as a test-readiness condition. Use a locator or application-specific assertion to establish that the content you need is ready.

Does fullPage: true trigger lazy loading?

No. It captures the page’s full scrollable extent; the script must trigger and verify lazy-loaded content before taking the screenshot.

What should I do with an infinite feed that has no end marker?

Set a target and a maximum number of scroll steps or elapsed time, then report that bound rather than promising a complete capture.

Quick Recap

Bestseller No. 2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Model: Dell OptiPlex 7050 Small Form Factor (SFF); Processor: Intel Core i7-7700 3.60 GHz; Memory: 32GB DDR4 Ram
$384.00
Bestseller No. 4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.; Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
$189.99
Bestseller No. 5
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections; Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
$255.00

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.