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

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 automate scrolling screenshots of multiple URLs with Playwright, reuse a browser page to visit each URL, wait for the content you need, and save a full-page image with page.screenshot({ fullPage: true }). For content that loads as you scroll, scroll explicitly before capturing: full-page mode captures the page content available at that moment; it does not guarantee that lazy-loaded or infinite content has appeared.

Set up a repeatable multi-URL capture

Install Playwright in a Node.js project, create the output folder, and run the script below. It processes URLs sequentially on one page, uses a navigation event followed by a readiness check, gives each screenshot a collision-resistant filename, and continues to the next URL if one capture fails.

  1. Install Playwright with npm install playwright. If your environment does not already have a compatible browser installed, install the browser for your project with npx playwright install chromium.
  2. Save the following as capture.mjs.
  3. Replace the sample URLs and replace the body wait with a locator that indicates the particular page’s important content is ready.
  4. Run node capture.mjs. The script creates a screenshots directory and writes one PNG per successfully captured URL.
import { chromium } from 'playwright';
import { mkdir } from 'node:fs/promises';

const urls = [
  'https://example.com/one',
  'https://example.com/two',
];

const outputDir = 'screenshots';
await mkdir(outputDir, { recursive: true });

const browser = await chromium.launch();
try {
  const context = await browser.newContext({
    viewport: { width: 1440, height: 900 },
  });
  const page = await context.newPage();

  for (const [index, url] of urls.entries()) {
    try {
      await page.goto(url, {
        waitUntil: 'domcontentloaded',
        timeout: 30_000,
      });

      // Replace with a page-specific readiness signal, for example:
      // await page.getByRole('heading', { name: 'Article title' }).waitFor();
      await page.locator('body').waitFor({ state: 'visible' });

      const filename = `${outputDir}/${String(index + 1).padStart(3, '0')}.png`;
      await page.screenshot({ path: filename, fullPage: true });
      console.log(`Saved ${filename} for ${url}`);
    } catch (error) {
      console.error(`Failed to capture ${url}:`, error);
      // Continue to later URLs. Throw here instead to fail the whole job.
    }
  }
} finally {
  await browser.close();
}

The body visibility check only confirms that a basic document element is visible. It does not establish that an application has finished fetching data or that images have loaded. Use a locator for the content that matters to the capture, and add a site-specific condition for any required images or data.

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

Choose navigation and readiness waits deliberately

page.goto supports load, domcontentloaded, networkidle, and commit as navigation wait states. domcontentloaded is often a practical starting point; follow it with a locator wait or assertion for the content you intend to capture. Navigation reaching a state is not the same as the page’s application being ready. See the Playwright Page API.

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • 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

Playwright describes networkidle as no network connections for at least 500 ms, but discourages using it as a testing readiness strategy and recommends web assertions instead. Pages with polling, analytics, or long-lived connections may not become idle in a useful way; a site-specific locator is usually a clearer signal. Do not add an arbitrary sleep as a substitute for knowing what must be present.

Capture ordinary long pages

For a long document whose content is already present, use fullPage: true. Playwright documents this as capturing the full scrollable page rather than only the visible viewport. The screenshot reflects the content available when capture occurs; the option does not promise to trigger every lazy-load behavior. The Playwright screenshots guide explains full-page capture as a screenshot of the scrollable page.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • 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.

Load content that appears only while scrolling

Some pages fetch images or additional records when a region enters the viewport. Infinite feeds may never have a natural end. For these cases, scroll deliberately before taking the full-page screenshot, wait for the expected content or a change in page state, and stop at a meaningful boundary or a defensible maximum.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
async function scrollToLoad(page, { maxSteps = 20, pauseMs = 500 } = {}) {
  let previousHeight = 0;
  let stableHeightCount = 0;

  for (let step = 0; step < maxSteps; step++) {
    const height = await page.locator('body').evaluate(el => el.scrollHeight);
    if (height === previousHeight) {
      stableHeightCount++;
      if (stableHeightCount >= 2) break;
    } else {
      stableHeightCount = 0;
      previousHeight = height;
    }

    await page.mouse.wheel(0, 800);
    await page.waitForTimeout(pauseMs);
  }

  await page.evaluate(() => window.scrollTo(0, 0));
}

// After navigation and the page-specific readiness wait:
await scrollToLoad(page, { maxSteps: 20, pauseMs: 500 });
await page.screenshot({ path: filename, fullPage: true });

This is a bounded starting pattern, not a universal infinite-scroll detector. A stable body height can occur even if content has not finished loading, and a page may change content without changing height. Prefer waiting for a known terminal element, expected item count, or site-specific loading indicator when available. For nested scroll containers, target and scroll that container rather than the page body. Virtualized lists may remove off-screen items, so full-page mode may not contain every record even after scrolling; capture the relevant sections individually or use the site’s own export if the complete dataset is required.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【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.

Playwright’s input guide covers scroll control, including mouse.wheel() and locator-based scrolling: Actions | Playwright. locator.scrollIntoViewIfNeeded() is useful when a particular element must be brought into view, but it is not a replacement for a loading and stopping strategy.

Sequential reuse or parallel pages?

The script reuses one page sequentially. This is simple and limits the number of active pages and their resource use. A browser context can contain multiple pages, so you can create several pages when parallel capture is useful and the target sites and machine can tolerate it; see Pages | Playwright. Parallelism can improve throughput, but consumes more memory and may increase load on the sites being visited. Start sequentially, measure your own workload, and add a bounded number of concurrent pages only when needed.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 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)

Context-level settings such as viewport and locale apply across pages in that context. Separate contexts can isolate site state, such as cookies, where that is necessary. Avoid unbounded concurrency: a large URL list is not a reason to open every page at once.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Adjust screenshot output and repeatability

  • Scale: scale: 'css' produces one image pixel per CSS pixel; scale: 'device' captures device pixels and can produce larger images on high-DPI displays.
  • Animation: animations: 'disabled' can reduce motion-related differences between captures.
  • Page styling and sensitive areas: use an injected stylesheet or masks when appropriate for the capture, while ensuring the result still represents the content you need.
  • Output: set the output type and path to match your workflow; use stable names based on an index or a sanitized URL so repeated runs do not accidentally overwrite unrelated files.
  • Timeouts: set navigation and locator timeouts based on your pages and job requirements. A timeout should lead to a recorded failure, not a misleading screenshot of a partial page.

These screenshot options are documented in the Page API reference. Choose scale and output dimensions based on the intended use: device scale may improve pixel density, while CSS scale typically keeps files smaller.

Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • 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

Troubleshoot common failures

  • Screenshot is only the first screen: confirm the screenshot call includes fullPage: true and that the site content exists in the page before capture.
  • Images or records are missing: the page may load them only when scrolled or after an application event. Scroll in bounded steps and wait for a relevant image, item, or completion signal.
  • Capture happens too early: domcontentloaded only marks a navigation milestone. Wait for a meaningful locator or assertion tied to the content being captured.
  • Navigation times out: check that the URL is reachable from the machine running Playwright and select a suitable navigation state. A timeout is not proof the page is ready; record the failure and decide whether to retry under a bounded policy.
  • Output files overwrite each other: use an index or sanitized URL in each filename, and create the output directory before capture.
  • Very tall screenshot is incomplete or impractical: check for virtualized content, nested scrollers, sticky UI, or site-specific limits. Capture sections separately when a single full-page image cannot represent the content reliably.
  • Run exits without closing cleanly: retain the browser close in a finally block so browser processes are released after errors.

Or skip the browser setup

If you want an API call instead of managing a browser and URL loop, ScreenshotNeo accepts a URL and returns an image or PDF. This cURL example saves a WebP screenshot of the target page:

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 documentation for request options. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

Sign up free for ScreenshotNeo.

Frequently Asked Questions

Does Playwright full-page capture scroll the page automatically?

It captures the full scrollable page available at capture time; it does not guarantee that scroll-triggered content has loaded.

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

Can I save each URL using its hostname or path?

Yes. Build a filename from a sanitized URL or combine it with the URL’s index, ensuring distinct paths for URLs that otherwise map to the same name.

Can one browser context handle multiple pages?

Yes. A BrowserContext can contain multiple pages, although reusing one page sequentially is often simpler and uses fewer resources.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.80
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.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.