To capture several URLs in one AWS Lambda invocation, launch one Lambda-compatible Chromium browser with puppeteer-core, create a separate Puppeteer page for each URL, and capture them with a bounded number of workers. Close each page when it finishes and close the browser even if a capture fails. There is no universal safe number of tabs: choose concurrency by measuring your pages, Lambda memory and timeout, output sizes, and the response of the sites you visit.
Choose a pattern for the size of your URL batch
There are two useful patterns. A single invocation can open multiple tabs in one browser, which is straightforward for modest batches. For a large batch of independent URLs, separate Lambda invocations can distribute the work and isolate failures. Neither approach has an established universal performance advantage: AWS’s published fan-out post is an architecture example, not a benchmark comparing it with multi-tab capture.
| Pattern | Best fit | Trade-offs |
|---|---|---|
| Several tabs in one invocation | A modest batch where shared browser startup and one result collection step are convenient. | Tabs share the invocation’s memory and time budget. A slow or resource-heavy page can affect the batch. |
| One URL per invocation (fan-out) | Large independent batches that can be processed and stored separately. | Requires orchestration and a way to collect results; more invocations can increase pressure on target sites and downstream systems. |
In either pattern, keep concurrency bounded. More tabs may raise memory use and make the target site receive more simultaneous requests. Choose the limit by load testing with representative URLs rather than treating a sample worker count as a Lambda guarantee.
Prepare a Lambda-compatible Puppeteer deployment
Use a matching Puppeteer and Chromium build
Use puppeteer-core with a Chromium distribution intended for serverless use, such as @sparticuz/chromium. The Chromium package documents its launch arguments, default viewport, executable path, and headless setting; a Serverless Framework example uses the same package pairing and launch sequence. Check compatibility guidance for the exact package versions you select rather than copying versions from an old tutorial: Sparticuz Chromium documentation and Serverless Framework Puppeteer example.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minute#1 Best Overall
- 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.
Check architecture and package size
Confirm the selected Chromium build supports the architecture configured for your Lambda function. The Serverless example notes that its Chromium build is x86_64-only; that is a property of that build, not of every Chromium package. Sparticuz also notes its compressed browser file is over 50 MB and points to a -min package for environments with package-size constraints. That option requires separately supplying the compressed browser files. Verify the current packaging instructions before deploying.
Configure memory and timeout for the whole job
A Lambda invocation must have time for navigation, any waiting, screenshot capture, serialization, and uploading results. AWS documents a configurable function timeout from 1 to 900 seconds (15 minutes); Lambda ends an invocation when its timeout expires. AWS also documents that memory settings determine proportional CPU allocation. Use representative load tests—including your upper-bound URL count and page sizes—to select memory and timeout. See AWS Lambda timeout configuration and AWS Lambda configuration troubleshooting.
Capture multiple URLs in one invocation
The following ES module handler takes an event shaped like {"urls":["https://example.com","https://example.org"]}. It starts at most three page workers, preserves results in input order, and closes each page and the browser during cleanup. The worker count is only a conservative starting point for testing, not a measured safe limit. The example returns PNG buffers; adapt result storage and response handling to your invocation and payload constraints.
Rank #2
- 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.
import chromium from '@sparticuz/chromium';
import puppeteer from 'puppeteer-core';
export const handler = async (event) => {
const urls = event.urls;
if (!Array.isArray(urls) || urls.some((url) => typeof url !== 'string')) {
throw new TypeError('event.urls must be an array of URL strings');
}
const browser = await puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath(),
headless: chromium.headless,
});
try {
const concurrency = Math.min(3, urls.length);
const results = new Array(urls.length);
let next = 0;
await Promise.all(Array.from({ length: concurrency }, async () => {
while (true) {
const index = next++;
if (index >= urls.length) return;
const page = await browser.newPage();
try {
await page.goto(urls[index], { waitUntil: 'networkidle0' });
results[index] = await page.screenshot({ type: 'png' });
} finally {
await page.close();
}
}
}));
return results;
} finally {
await browser.close();
}
};
What to adjust before using it in production
- Navigation readiness:
networkidle0waits for network activity to settle. Pages with long-polling, analytics, or continuously active requests may not reach that state promptly. Choose a wait condition or selector appropriate to the page and put an explicit navigation or task timeout around your workflow. - Input validation: the example checks that URLs are strings, but a production handler should also enforce an allowed URL scheme and any host allowlist required by your application. Do not accept arbitrary URLs from untrusted callers without considering server-side request risks.
- Output handling: screenshots are binary buffers. For larger batches, upload each result to object storage such as S3 and return object keys rather than trying to return every image inline. Account for upload time in the invocation budget.
- Failure policy: as written, a failed navigation or screenshot rejects the worker pool and invocation, while
finallystill closes resources. If partial results are useful, catch errors per URL and store an explicit success/error result at that URL’s index. - Empty input: with an empty URL array the worker count is zero and the handler returns an empty result array after launching and closing the browser. If empty jobs are common, validate before launching to avoid unnecessary browser startup.
Scale large batches with separate Lambda invocations
When URLs are independent and a batch no longer fits comfortably within one invocation’s time or memory budget, fan them out: a coordinator submits one capture task per URL, and a browser function captures the page and writes the screenshot to S3. AWS published an example of this pattern on 31 March 2021, using a fan-out function to asynchronously invoke a Puppeteer function for each URL and save screenshots in S3. Treat it as an architectural example; use current Lambda, deployment, and orchestration documentation for present-day configuration. See AWS Architecture Blog: Scaling browser automation with Puppeteer on AWS Lambda.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Fan-out improves isolation because one URL can fail without necessarily discarding all other captures, provided the coordinator records individual outcomes. It does not remove resource planning: control invocation concurrency, consider the target sites’ rate limits, and ensure S3 or other downstream services can handle the write volume. AWS Lambda best practices recommend analyzing maximum memory use, load testing timeout choices, and accounting for upstream and downstream throughput as concurrency grows. See AWS Lambda best practices.
Use CloudWatch Synthetics for scheduled browser monitoring
If the real task is scheduled monitoring rather than an application-controlled batch capture, CloudWatch Synthetics is a distinct option. AWS documents Puppeteer screenshots and multi-tab canaries. Its runtime release bundles specific Puppeteer and Chromium versions, so those versions should not be assumed to apply to a standalone Lambda package. See CloudWatch Synthetics canaries.
Rank #3
- 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.
Or skip the browser setup
ScreenshotNeo can capture a URL through one GET request, without packaging Chromium or managing browser tabs. It accepts 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/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in headers. Its 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 shots per month without a card; paid plans start at $5 for 3,000 shots. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Sign up for 1,000 free screenshots a month, with no card required.
Troubleshoot common failures
Chromium fails to launch
Check that the deployed Chromium package supports your Lambda architecture, that the browser files are included or available as required by the selected package, and that the launch uses the package’s arguments and executable path. Confirm the exact Puppeteer and Chromium versions are compatible. A package that works locally may not match the Lambda deployment environment.
Deployment package is too large
Review the deployed artifact and the selected Chromium package’s current packaging guidance. Sparticuz documents a compressed browser file over 50 MB and describes a -min option that requires separate compressed browser files. Choose packaging based on your deployment limits rather than removing required browser assets.
Rank #4
- 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
Navigation hangs or times out
Some pages do not become network-idle because of persistent connections or recurring requests. Use a readiness condition that matches the page, such as waiting for a meaningful selector, and set bounded timeouts. Also check whether the Lambda timeout leaves enough time for screenshot and upload steps after navigation.
Memory usage grows or the function times out
Reduce the number of simultaneous pages, capture fewer URLs per invocation, or distribute work across invocations. Measure maximum memory and duration with representative pages and outputs. AWS recommends load testing rather than selecting timeout and memory settings by guesswork.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Some URLs fail while others succeed
Decide whether the job should be all-or-nothing or return per-URL outcomes. To retain partial results, catch errors inside each worker and record an error for that input index instead of allowing one rejection to discard the invocation’s aggregate result. Always retain cleanup in finally.
Best Value
- 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.
Captures overload sites or storage
Lower browser worker concurrency or fan-out concurrency and consider the target site’s permitted request rate. For distributed jobs, monitor the capacity of S3 or any other result store as well as Lambda concurrency; increasing browser parallelism can shift the bottleneck downstream.
FAQ
Does each URL need its own browser?
No. The multi-tab pattern uses one browser and creates a separate Puppeteer Page for each URL. Separate invocations are an alternative for scaling and failure isolation, not a requirement for opening multiple pages.
Can I use the same Puppeteer versions bundled in a Synthetics runtime?
Only if your deployment actually uses that Synthetics runtime. AWS ties bundled versions to runtime releases; for a standalone Lambda package, check compatibility for the versions you deploy.
Recommended Free Tools
Should I use a fixed number of tabs for every Lambda function?
No. Workload size, page behavior, memory, timeout, and destination-site capacity differ. Determine a suitable cap with a representative workload on the configured function.
Quick Recap
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.

