DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween 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 Now×
FREEDOM251

Freedom251 › Blog › JavaScript

How to Take Full-Page Screenshots of Long Product Listings with Playwright

By Freedom251 Team · · 4 min read

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

Use Playwright’s page screenshot API with fullPage: true to save the full scrollable page as one image:

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

This captures the page’s full scrollable extent, not just the currently visible viewport. If you only need the product grid or a single product card, capture that element with a locator instead.

As an Amazon Associate I earn from qualifying purchases.

Capture the full product listing as one image

In a Playwright script, navigate to the listing and call page.screenshot() with a file path and fullPage: true. The example assumes page is an already-created Playwright Page and that navigation has completed:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.goto('https://example.com/products');
await page.screenshot({ path: 'listing.png', fullPage: true });

Playwright defines a full-page screenshot as a capture of the full scrollable page, as though it were displayed on a very tall screen. See the Playwright screenshot guide and Page screenshot API reference.

#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)

Capture only the listing or one product card

When the desired image is a particular element rather than the whole document, take a locator screenshot. For example, if the page exposes a stable test ID for its product list:

await page.locator('[data-testid="product-list"]').screenshot({ path: 'products.png' });

[data-testid="product-list"] is illustrative: inspect the actual site and use a locator that matches its markup or testing contract. Playwright recommends locators based on user-facing roles, text, labels, placeholders, alt text, titles, or test IDs. Long CSS or XPath chains tied to DOM structure are more likely to break when the page changes. See Playwright’s locator guidance.

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)

Check dynamic listings before relying on the image

fullPage: true determines the capture extent; it does not promise that a site-specific listing has rendered every product. Listings may use lazy-loaded images, infinite scrolling, or virtualization, where only a portion of the items exists in the page at a given time. The right way to prepare such a page depends on how that site implements loading. Inspect the target page, use the site’s actual loading behavior if necessary, and verify the resulting image includes the products you intended to capture.

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

In particular, do not assume that an image of a full-height page proves every listing item was loaded. Compare the output with the expected contents of the listing.

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.

Choose file output, format, and image scale

For a saved file, supply path; the extension can determine the image type. Playwright supports PNG, JPEG, and WebP. If later code needs to process the image without first reading a file, omit the path and use the returned buffer:

const imageBuffer = await page.screenshot({ fullPage: true });

The Page API also documents clipping, masking locators, applying a stylesheet for the screenshot, and choosing CSS-pixel or device-pixel scaling. Choose these options according to whether the image is evidence, a report asset, or a test artifact, and check the API reference for the options supported by your installed Playwright version.

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.

Use the Playwright CLI for a one-off capture

If you want a command-line capture rather than a Node.js script, the Playwright CLI supports screenshot --full-page. Keep the CLI syntax separate from the Page API syntax:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx playwright screenshot --full-page https://example.com/products listing.png

The CLI documentation also covers filename, image type, and high-resolution flags; consult the Playwright CLI reference for the syntax available in your installed version.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use screenshot assertions for visual regression

For a repeatable visual check in Playwright Test, use toHaveScreenshot() rather than treating a one-off file capture as a test:

await expect(page).toHaveScreenshot();

Playwright’s screenshot assertion waits for consecutive screenshots to match before comparing against the stored expectation. Keep the rendering environment consistent when maintaining baselines: operating system, browser version, settings, hardware, and other environmental factors can affect rendering. See Playwright’s visual comparisons guide.

Troubleshoot missing or unexpected content

  • The image stops at the viewport: Check that the call is page.screenshot({ path: 'listing.png', fullPage: true }) and not a locator screenshot or CLI call with a different syntax.
  • Some products or images are absent: Inspect whether the site loads content on scroll or virtualizes list items. The full-page option captures the page extent; it does not supply a universal recipe for triggering each site’s loading behavior.
  • The wrong area was captured: Use page.screenshot() for the whole page, or choose a locator screenshot when the intended target is a listing region or card.
  • A locator screenshot fails or targets the wrong element: Verify the locator against the live page and prefer a stable semantic locator or test ID over a brittle chain of DOM selectors.
  • The image type or resolution differs from expectations: Check the file extension and the screenshot options supported by the Playwright version installed in the project.
  • Visual regression differs between runs: Align the browser and host environment used to create and compare baselines; rendering can vary across environments.

Or skip the browser setup

If you need a screenshot without building a Playwright capture flow, ScreenshotNeo returns an image or PDF from one request. Its API accepts a URL and supports PNG, JPEG, and WebP output. The following cURL example saves the target page as WebP; see the ScreenshotNeo documentation for request options.

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://example.com/products -o listing.webp
  • Cookie banners are accepted and more than 60 known consent platforms, newsletter popups, and chat widgets are removed before capture; each of these steps can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; the response identifies the page verdict and billing status in headers.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
  • The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

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
$269.99

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.

JavaScriptPlaywrightscreenshotsvisual testingWeb development

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.