Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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 NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › JavaScript

How to Capture Full-Page Screenshots of Dynamic Pages in Playwright

By Freedom251 Team · · 4 min read

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

Use await page.screenshot({ path: 'page.png', fullPage: true }) to capture the full scrollable page. For dynamic pages, first wait for the specific content the screenshot must include; if content loads as you scroll, scroll to those sections and verify they have appeared before capturing. The full-page option controls screenshot extent, not when your application is ready.

Capture the full scrollable page

After navigating to the target URL, pass fullPage: true to page.screenshot(). Playwright captures the full scrollable page rather than just the visible viewport. The path option writes the resulting image to a file.

As an Amazon Associate I earn from qualifying purchases.

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

This assumes you already have a Playwright page open on the page you want to capture. The screenshot call does not ensure that asynchronous content, images, or other application data have finished loading.

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

Wait for the content the screenshot needs

Choose a page-specific readiness condition: for example, a heading, result list, image, or other element that should be present in the final capture. Wait for that element to become visible or reach the state your screenshot requires.

#1 Best Overall
Lavsoul 4K Webcam with Microphone for PC & Streaming Computer Camera | PDAF autofocus, dual noise-canceling mics & low-light correction. Best usb hd webcam for mac, laptop and smooth streaming.
  • ULTRA HD 4K CLARITY: Stand out in every video call with breathtaking 4K video at 30fps or smooth 1080p at 60fps. Powered by a premium 1/2.5" CMOS sensor and a wide f/1.78 aperture, this webcam captures every detail with vibrant color and stunning low-light performance-so you always look your best
  • FAST AUTOFOCUS & SMART LIGHT CORRECTION: No more blurry moments with this webcam for PC. Advanced Phase Detection Auto Focus (PDAF) locks onto your face instantly and keeps you sharp-even when you move. Built-in light correction adapts to your environment, balancing brightness and contrast for a flawless image in dim rooms or bright spaces
  • DUAL NOISE-CANCELING MICS: Speak with confidence using this webcam with microphones. Dual microphones with intelligent noise-canceling tech isolate your voice and reduce background noise-suitable for webinars, live streams, team meetings, and virtual interviews
  • WIDE-ANGLE LENS & FLEXIBLE MOUNTING OPTIONS: Capture more of your world with an 80 field of view and full 360 swivel rotation. Whether this streaming webcam is mounted on a laptop, monitor, or tripod, it allows you to find the right angle for any setup
  • BUILT-IN PRIVACY COVER & PLUG-AND-PLAY SIMPLICITY: Protect your privacy with a secure sliding lens cover that blocks the camera when not in use. Setup is a breeze-just plug into any USB-A port and start streaming, chatting, or recording instantly. The USB webcam is compatible with Zoom, Microsoft Teams, Skype, OBS Studio, and all major platforms across Windows, macOS, and Linux
await page.goto(url);

// Replace this with a locator that signals the page's real ready state.
await page.getByRole('main').getByText('Expected section').waitFor({ state: 'visible' });

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

The example locator is illustrative. Replace it with a stable locator and expected content from the target site. Playwright discourages using networkidle as a general test-readiness strategy: network quiet does not prove that the particular application content you need is ready. The Playwright Page API recommends web assertions to assess readiness.

Handle content that loads while scrolling

Some pages fetch or render content only when a section approaches the viewport. In that case, visit the relevant sections before taking the full-page screenshot, then wait for the expected content there. Playwright provides locator.scrollIntoViewIfNeeded() to bring a target into view.

Rank #2
10.1 Inch Mini Netbook, Quad-Core Processor Laptop Computer, 2GB Memory 64GB Storage Android 12 Portable Notebook Built-in Webcam, WiFi & Bluetooth Keyboard & Mouse for Home Schooling & Office Work
  • 【Efficient Quad-Core Performance】 Powered by a 1.8GHz Quad-Core processor, this mini laptop ensures smooth multitasking. With 2GB RAM and 64GB ROM (expandable to 1TB), it handles daily work and online tasks with ease.
  • 【10.1" HD IPS Display & GMS Support】 Featuring a 1280x800 HD IPS screen, this cheap laptop delivers vibrant visuals. Pre-installed with Android OS and GMS, you get direct access to the Google Play Store for apps.
  • 【Ultra-Portable & Lightweight Design】 Weighing only 1.76 lbs, this Blue computer is designed for mobility. Its compact form makes it an ideal companion for students and professionals for home schooling or trips.
  • 【Versatile Connectivity Options】 Stay productive with dual USB 2.0 ports, a headphone jack, and a TF card slot. This computer for kids and adults features built-in Wi-Fi and Bluetooth for stable connections.
  • 【Complete All-in-One Bundle】 This kid laptop kit includes the laptop, carrying bag, mouse, mouse pad, and power adapter. It is the perfect ready-to-use set for online classes, remote work, and entertainment.
await page.goto(url);

await page.getByRole('main').getByText('Expected section').waitFor({ state: 'visible' });

// Trigger loading near a later section, then verify it appeared.
await page.locator('#last-section').scrollIntoViewIfNeeded();
await page.locator('#last-section').waitFor({ state: 'visible' });

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

Replace #last-section and the text locator with selectors that match the site. A full-page capture does not guarantee that every site’s lazy-loading mechanism has been triggered; confirm the target’s behavior rather than assuming the screenshot operation will scroll through it for you.

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

Set a stopping condition for infinite feeds

An infinite feed may keep expanding as more items load, so “the full page” may not have a useful fixed endpoint. Decide what the capture should contain—for example, a known number of items or a terminal marker—and stop once that condition is met. This is a practical boundary to define for the capture, not a special Playwright guarantee.

Rank #3
Sale
Logitech C920x HD Pro Webcam, Full HD 1080p/30fps - Black w/Blue Yeti USB Microphone - Blackout
  • Webcam comes with a 3-month XSplit VCam license and no privacy shutter. XSplit VCam lets you remove, replace and blur your background without a Green Screen.
  • Full HD 1080p video calling and recording at 30 fps - You’ll make a strong impression when it counts with crisp, clearly detailed and vibrantly colored video.
  • Stereo audio with dual mics - Capture natural sound on calls and recorded videos.
  • Custom three-capsule array: This professional USB mic produces clear, powerful, broadcast-quality sound for YouTube videos, Twitch game streaming, podcasting, Zoom meetings, music recording and more
  • Blue VOICE software: Elevate your streamings and recordings with clear broadcast vocal sound and entertain your audience with enhanced effects, advanced modulation and HD audio samples

Reduce visual variation when needed

For repeatable screenshots, the Page screenshot API supports animations: 'disabled', mask locators, and a screenshot style stylesheet. These options can reduce variation from animations or deliberately hide or restyle regions such as timestamps and ads. They do not wait for missing application data to load.

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

Disabling animations is useful when visual comparisons should be repeatable. If the screenshot needs to show the live animation state, leave animation behavior allowed. Use masks or injected styles only when hiding or restyling those regions is appropriate to the image’s purpose. Check the Page API reference for options supported by your installed Playwright version.

Rank #4
Webcam Cover for Logitech C920 C930e c922x Lens Privacy Shutter Slider
  • Compatible with Logitech C920x HD Pro Webcam, Full HD 1080p/30fps Video Calling. Compatible with Logitech C920 Hd Pro Webcam. Compatible with Logitech HD Pro Webcam C920 Widescreen Video Calling and Recording Webcam.
  • Compatible with Logitech C930e Webcam. Compatible with Logitech C922 Pro Stream Webcam 1080P Camera for HD Video Streaming. Compatible with Logitech Privacy Cover for C920 and C930e.
  • This webcam cover conveniently blocks your camera cover to protect your privacy.
  • This also compatible with other popular webcams. This is also known as webcam lid, webcam cap, webcam protector, web camera privacy cover.
  • ienza is a registered trademark and a registered Amazon brand. Use of the ienza trademark without the prior written consent of ienza, LLC. may constitute trademark infringement and unfair competition in violation of federal and state laws. ienza products are developed as cost-effective alternatives to OEM parts. They are not necessarily endorsed by the OEMs
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the capture approach by page behavior

Page behavior Approach Trade-off
Required content is already rendered Wait for an application-specific ready condition, then call screenshot({ fullPage: true }). Simple capture, but completeness still depends on choosing a meaningful readiness check.
Content appears in response to scrolling Scroll to relevant sections, wait for their expected content, then capture. Gives you control to trigger and verify loading, but requires site-specific selectors and a defined stopping condition.

Troubleshooting

  • The screenshot is missing a section: The section may not have loaded before capture, or may load only when scrolled into view. Add a wait for the expected content and, if needed, scroll to the section before capturing.
  • The wait passes but the page is still incomplete: The locator may signal only partial readiness. Wait for the actual result, image, item count, or other state the screenshot needs rather than a generic page or network condition.
  • The capture keeps growing on a feed: Define a finite completion rule, such as a target item count or terminal marker, instead of treating an infinite feed as having a fixed full-page endpoint.
  • Images or animations vary between captures: Verify that the required images have loaded. To reduce animation-related variation, use animations: 'disabled'; masks and screenshot styles can address intentional visual noise, but cannot load missing content.
  • A selector does not work on the target site: Replace the example selector with a stable locator from that page. Lazy-loading behavior and selectors are site-specific.

Or skip the browser setup

ScreenshotNeo is a website screenshot API: one GET request returns an image or PDF. For a full-page WebP screenshot, use full_page=true:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -d full_page=true -o shot.webp

See the ScreenshotNeo documentation for API parameters. ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Sign up free for 1,000 screenshots a month with no card.

Frequently Asked Questions

Does fullPage: true capture content that has not loaded yet?

No. It captures the full scrollable page extent, but it does not establish that asynchronous page content is ready.

Should I use networkidle before a screenshot?

Not as a general readiness test. Wait for the page-specific content the image needs; network quiet alone does not confirm that content is present.

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.

JavaScriptPlaywrightscreenshotsweb automation

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.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.