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

The fastest safe way to speed up a Playwright scraper is to stop waiting for events and downloading resources the extraction does not need—without sacrificing complete, correct records. Start by measuring one representative run, replace broad waits with a signal tied to the data you need, and test selective request blocking and controlled parallelism against the actual target pages. Playwright documents these techniques and their trade-offs, but does not publish a universal scraper speedup or concurrency limit.

Find out where the time goes before changing the scraper

Make a baseline run with the same URLs, extraction logic, browser version, machine conditions, and output requirements you will use to judge an optimization. Record elapsed time and whether every required record was collected correctly. Faster execution that silently misses lazy-loaded content or dynamically rendered fields is not an improvement.

Break the run into observable stages: navigation, waiting for the required content, response time, extraction and parsing, and any local queue or orchestration time. Playwright’s network guide describes monitoring requests and responses; use that information to distinguish remote-site latency from browser work and local processing. Change one factor at a time and compare completed, correct records as well as wall-clock duration.

Wait for the data you need, not every network request

page.goto() defaults to load. Its waitUntil options are commit, domcontentloaded, load, and networkidle. The Page API defines networkidle as no network connections for at least 500 ms and explicitly discourages using it as a general readiness test. Analytics, polling, ads, and other background traffic can make network quietness unrelated to whether the target data is ready. See the Page API.

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.

Choose the earliest navigation event that still leaves the document in a useful state, then wait for the specific content your scraper will extract. For a dynamically rendered field, a locator wait is usually a better readiness condition than an arbitrary pause. Do not stack fixed sleeps on top of navigation and content-ready waits unless the page has a demonstrated timing requirement; a fixed delay can waste time on fast responses and still be too short on slow ones.

Example: wait for a target result

This Node.js example waits for the document to be committed, then for a result element before reading it. Replace the URL and selector with those for the site you are permitted to scrape.

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext();
  const page = await context.newPage();

  try {
    await page.goto('https://example.com/products', {
      waitUntil: 'domcontentloaded',
      timeout: 30_000,
    });

    const result = page.locator('[data-testid="product-result"]').first();
    await result.waitFor({ state: 'visible', timeout: 15_000 });
    console.log(await result.textContent());
  } finally {
    await context.close();
    await browser.close();
  }
})();

Use commit only when an even earlier document-start signal is sufficient for the next step; it does not mean that the page’s content is ready. If the data arrives from a specific response, you can wait for the relevant response condition instead of waiting for unrelated traffic to stop.

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.

Skip requests only when the extraction can do without them

Routing lets a handler continue, abort, or fulfill requests. If a scrape does not use a particular class of resource, selectively aborting it may reduce transfers and browser work. It is not universally safe to block images, stylesheets, fonts, or scripts: pages may rely on them for layout, lazy loading, or application behavior. Test the extracted fields and records after every change. Playwright’s network guide covers request handling.

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

Example: selectively abort image requests

Install the route before navigation so it can handle requests from the beginning of the page load.

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext();
  const page = await context.newPage();

  await page.route('**/*', async route => {
    const request = route.request();
    if (request.resourceType() === 'image') {
      await route.abort();
    } else {
      await route.continue();
    }
  });

  try {
    await page.goto('https://example.com/products', {
      waitUntil: 'domcontentloaded',
      timeout: 30_000,
    });
    await page.locator('[data-testid="product-result"]').first().waitFor();
    // Extract the fields the scraper actually needs here.
  } finally {
    await context.close();
    await browser.close();
  }
})();

Two routing caveats can reverse the expected gain. First, enabling routing disables the HTTP cache, so repeat visits may become slower even if some requests are removed. Compare cold and repeat runs when caching matters. Second, context routing does not intercept requests handled by a service worker. Playwright documents the behavior in the BrowserContext API; its service workers guide explains the interception considerations. Blocking service workers may be appropriate for an interception experiment, but can also change the target site’s behavior—only do so when that behavior remains representative of the scrape you need.

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.

Reuse the browser, and make context and page lifetimes explicit

For a batch, keep a browser process open rather than launching a fresh one for every URL, while creating contexts at the boundaries where sessions need to be isolated. A context keeps its own session state; pages within it share that context. Close pages or contexts deliberately when their work is done, and close the browser at the end of the batch.

Playwright describes browser contexts as isolated and fast and cheap to create within one browser. Its Browser API recommends explicit context and page management for production lifecycle control; browser.newPage() is a convenience API intended for short, single-page scenarios. The browser contexts guide explains isolation. These sources do not quantify a speed gain for a particular scraper, so measure your own batch rather than assuming a percentage improvement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  try {
    for (const url of ['https://example.com/a', 'https://example.com/b']) {
      const context = await browser.newContext();
      try {
        const page = await context.newPage();
        await page.goto(url, { waitUntil: 'domcontentloaded' });
        await page.locator('main').waitFor();
        // Extract and persist this URL's data.
      } finally {
        await context.close();
      }
    }
  } finally {
    await browser.close();
  }
})();

If URLs can safely share session state, a context may be reused too; if cookies or other state must remain isolated, retain separate contexts. The right boundary depends on the site’s behavior and your data requirements, not a universal performance rule.

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

Increase concurrency gradually, not by guesswork

Multiple isolated contexts can run within one browser, but Playwright’s documentation does not establish a safe number of simultaneous pages or contexts for arbitrary sites. Nor does it set a universal rate for scraping. The useful level depends on page weight, target-site response behavior, your machine’s available memory and CPU, and the failure rate you can tolerate.

  1. Start from the measured sequential baseline.
  2. Run a small number of independent jobs concurrently and verify record completeness.
  3. Increase concurrency incrementally while tracking elapsed time, completed records, failures, memory use, and the target site’s responses.
  4. Stop increasing when throughput stops improving or resource use and failures rise; reduce concurrency if responses become unreliable.

Playwright’s Fixtures API documents isolated contexts used efficiently within a browser, but this is not a recommendation of a numeric production limit. Follow applicable site rules and avoid treating concurrency as a substitute for a readiness or request-volume problem.

Separate scraper overhead from slow or variable dependencies

A scraper’s elapsed time can be dominated by a third-party dependency or target response rather than Playwright itself. Playwright’s best practices notes that third-party dependencies can make tests time-consuming and slow, and advocates controlled network responses in tests. For a real scrape, use that as a diagnostic distinction—not as a reason to mock the data source you need to collect. Mocking can help test parsing and orchestration separately, but it cannot establish how quickly the live target will return data.

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.

Measure the parts you control, and keep a live-page validation run for extraction correctness and target behavior. Avoid attributing a faster mocked test to a faster production scrape.

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

Choose an optimization by its trade-off

Change Potential benefit Risk or limitation How to validate
Use an earlier navigation event and a specific readiness condition Avoid waiting for irrelevant load or background network activity. The chosen signal may precede dynamically rendered data. Confirm all required fields and records are present.
Abort unneeded request types Reduce transfers and browser work for assets the extraction does not use. May break layout, lazy loading, or application behavior; routing disables HTTP cache. Compare extraction correctness and cold/repeat timing.
Reuse the browser process Avoid repeatedly launching browsers across a batch and retain explicit lifecycle control. Contexts and pages still consume resources; isolation requirements vary. Track batch time, memory, and session boundaries.
Increase concurrent contexts May increase throughput when jobs can run independently. No universal safe limit; failures or resource use may increase. Increase in small steps and compare correct completed records.
Mock dependencies in local tests Can isolate parsing and orchestration from slow external dependencies. Does not measure live-target latency or validate live-page behavior. Keep a separate validation run against real target pages.

Troubleshoot slow or incomplete runs

  • The page seems to wait indefinitely: Check whether the scraper uses networkidle on a page with persistent traffic. Replace broad quietness waiting with a target-specific locator or response condition, and set a timeout appropriate to the page.
  • The scraper is fast but returns missing fields: The navigation event may occur before client-rendered data appears. Wait for the relevant element or response, and confirm lazy-loaded data is triggered before extraction.
  • Blocking images makes the page hang or changes results: The site may depend on image or related page behavior for lazy loading or rendering. Remove the block or test a narrower resource filter; do not assume an asset is irrelevant because it is not extracted.
  • Routing makes repeated visits slower: Routing disables HTTP cache. Compare repeat visits without routing and only keep interception if its saved work outweighs the cache loss for your workload.
  • A route handler does not see a request: A service worker may be intercepting it. Review Playwright’s service workers guidance and test with service workers blocked only if doing so preserves the target behavior you intend to scrape.
  • More parallel jobs increase errors or slow the batch: Reduce concurrency and compare response failures, memory use, and completed records. There is no documented universal concurrency number to apply to every site.
  • Runs vary substantially: Keep target URLs, browser version, machine conditions, and extraction requirements constant in comparisons, and separate time spent in remote responses from local parsing and orchestration.

Or skip the browser setup

If your task is to capture a page as an image or PDF rather than extract structured records through a custom browser workflow, ScreenshotNeo offers a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. For example, the cURL request below captures a page as WebP:

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 details. ScreenshotNeo accepts cookie or consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; those steps can each be turned off. Bot checks, 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 using Claude, Cursor, or another MCP client. The free plan includes 1,000 screenshots per month without a 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.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

FAQ

Does Playwright publish a percentage speedup for these changes?

No. The cited Playwright documentation describes API behavior and trade-offs, but does not publish a universal scraper benchmark or percentage improvement.

Does Playwright specify a safe concurrency limit for scraping?

No universal number is established in the reviewed guidance. Determine the useful level for the target, workload, and machine by measuring throughput and failures as concurrency changes.

Is a screenshot API a substitute for scraping structured data?

Not necessarily. A screenshot captures a visual page or PDF; structured extraction may still require selectors, application-specific logic, or data handling in a browser workflow.

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.