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.

Set the timeout on each page.goto() call inside your URL loop: await page.goto(url, { timeout: 15_000, waitUntil: 'domcontentloaded' }). The timeout is in milliseconds and applies to that navigation, not automatically to the screenshot or the whole script.

Set a separate navigation timeout for each URL

Pass timeout in the options object for page.goto(). This gives each loop iteration its own navigation limit. The example below uses a 15-second limit and continues to the next URL if navigation or the screenshot operation throws an error.

const timeoutMs = 15_000;

for (const url of urls) {
  try {
    await page.goto(url, {
      timeout: timeoutMs,
      waitUntil: 'domcontentloaded',
    });

    await page.screenshot({ path: screenshotPathFor(url) });
  } catch (error) {
    console.error(`Failed for ${url}:`, error);
  }
}

Replace urls with your URL array and screenshotPathFor(url) with your own filename-generation function. The URL-specific bound is the goto timeout; the try/catch also handles errors from screenshot(), which has no timeout set in this example. See the Playwright Page API for the navigation options.

Use a different limit for each URL

Calculate a timeout before each navigation if some pages need more time than others. The timeout value still belongs on the individual call:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
for (const url of urls) {
  const timeoutMs = timeoutForUrl(url);

  try {
    await page.goto(url, {
      timeout: timeoutMs,
      waitUntil: 'domcontentloaded',
    });
    await page.screenshot({ path: screenshotPathFor(url) });
  } catch (error) {
    console.error(`Failed for ${url} (limit: ${timeoutMs} ms):`, error);
  }
}

Define timeoutForUrl to return a millisecond value based on your own URL rules. For instance, you can use a longer limit for a known slow site and a shorter one for pages expected to respond quickly.

Choose what counts as navigation completion

The timeout limits how long Playwright waits for the completion condition you select with waitUntil. The Page API lists load as the default and also supports domcontentloaded, networkidle, and commit. Choose the condition that matches what the screenshot needs: reaching a navigation milestone does not necessarily mean every image, widget, or other visual element is ready.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
  • domcontentloaded waits for the document’s initial HTML to be parsed; it can be useful when waiting for every dependent resource would take too long.
  • load is the documented default navigation condition.
  • networkidle waits for network activity to become idle. Playwright discourages using it for testing, so do not select it automatically as a general readiness guarantee.
  • commit waits until the response is received and the document starts loading.

If the screenshot depends on a particular element or application state, use an explicit readiness check appropriate to that page rather than assuming that a navigation state means the final visual content is ready. The documented conditions and guidance are in the Page API.

Understand timeout scope and precedence

Playwright offers several timeout settings, but they do not all bound the same work. For a bulk loop where each URL needs its own limit, the per-call goto option is the most direct setting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Setting Scope When it fits
page.goto(url, { timeout }) That navigation call Set a fixed or URL-specific bound in a loop.
page.setDefaultNavigationTimeout(ms) Navigation methods on the page, including goto, goBack, goForward, reload, and waitForURL Set a page-wide navigation default when calls do not need different limits.
page.setDefaultTimeout(ms) Page methods that accept a timeout option Set a general page default. A navigation-specific default takes priority over this general default.
browserContext.setDefaultNavigationTimeout(ms) or browserContext.setDefaultTimeout(ms) Context-wide navigation or general defaults Set defaults shared across pages in a context. Page-level settings take priority over context-level settings.
Playwright Test timeout The test’s execution budget Limit a test as a whole; it is distinct from a timeout for an individual navigation or action.

The page and context APIs document these settings and precedence rules: Page API and BrowserContext API. The distinction between a test budget and an individual operation is also covered in the Playwright Test timeouts guide.

Keep navigation limits separate from workflow limits

A goto timeout does not set a deadline for the full script, the screenshot call, or later processing. A navigation can finish within its limit and a later screenshot or file operation can still fail or take additional time. If the bulk job needs an end-to-end runtime bound, design and enforce that separately; do not treat the navigation setting as a complete workflow deadline.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Troubleshoot timeout and screenshot failures

  • A URL times out even though other URLs succeed: The selected navigation condition was not reached within that URL’s limit. Check that the URL is reachable and that the chosen waitUntil state is appropriate. If justified, return a longer value from timeoutForUrl(url).
  • The loop stops at the first failure: Make sure navigation and screenshot calls are inside the per-URL try/catch. Log the URL with the error so one failure does not hide which item failed.
  • The navigation succeeds but the screenshot fails or is incomplete: A navigation timeout only bounds goto. Check the screenshot error separately and wait for the content the capture actually needs instead of assuming a navigation milestone guarantees visual readiness.
  • A page-wide default does not affect a navigation as expected: Check for a navigation-specific default, which takes priority over the general page default; also check page-level settings before context-level defaults.
  • The test ends before a navigation’s own timeout: The Playwright Test timeout is a separate, broader execution budget. Review the test timeout and the individual navigation timeout as distinct limits.

Playwright also documents related navigation timeout and wait-state behavior for frames in the Frame API.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your task is simply to capture URLs rather than control a Playwright browser workflow, ScreenshotNeo offers a one-request screenshot API. Its options also accept the parameter names used by other screenshot APIs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
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. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, 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 tools for AI agents. 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 to get 1,000 free screenshots a month with no card.

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.