What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Run Selenium with a compatible headless Chromium bundle inside Lambda, navigate to the page, wait for the content you need, then save or return the screenshot before the invocation ends. The central challenge is packaging a browser, driver and native libraries that match your Lambda runtime and architecture; the Selenium capture call itself is straightforward.
What you need to make work
A Lambda screenshot function combines four parts: your Python handler, Selenium, a Chromium browser and its matching WebDriver. The browser and driver must run with the selected Lambda operating system, runtime and instruction-set architecture. Native libraries must be compatible too. AWS supports ZIP deployment packages (with dependencies in the ZIP or a layer) and container images, but the official guidance does not specify a universally compatible Chromium bundle or launch-flag set. Pin and verify the browser, driver and dependencies together for your build rather than assuming an older community layer works.
AWS explains that native-code packages need a compatible build environment and documents both ZIP and container-image deployment options in its Python deployment package documentation.
Choose ZIP and layers or a container image
| Choice or limit | Current AWS value or guidance | What it means for Selenium |
|---|---|---|
| ZIP package, including layers | 250 MB unzipped — Amazon Web Services, checked 2026-10-03; see Lambda quotas. | Count the combined unzipped contents of the function package and its layers, including browser-related dependencies. |
| Container image, including layers | 10 GB maximum uncompressed image size — Amazon Web Services, checked 2026-10-03; see Lambda quotas. | Provides substantially more packaging headroom, but does not remove runtime, architecture or native-library compatibility requirements. |
| Function timeout | 900 seconds (15 minutes) maximum — Amazon Web Services, checked 2026-10-03; see Lambda quotas. | Allow for browser startup and page navigation, and set a finite Selenium page-load timeout. |
| Ephemeral storage | 512 MB to 10,240 MB — Amazon Web Services, checked 2026-10-03; see Lambda quotas and ephemeral storage configuration. | Choose capacity for browser files, temporary downloads and screenshots, based on the actual workload. |
Use ZIP and layers when the compatible browser bundle fits the package limit and is manageable in your build workflow. Consider a container image when maintaining the browser and system dependencies as an image is more practical. AWS publishes limits, not a Selenium performance comparison between these deployment choices, so select based on packaging and operational needs rather than presumed speed.
#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.
Build and configure the Lambda browser bundle
- Choose the runtime and architecture. Record the Lambda runtime and instruction-set architecture first. Build or obtain Selenium, Chromium, the driver and native libraries for that environment, and pin their versions in your deployment process.
- Package the function. Put your handler and dependencies in the expected ZIP layout, optionally using a layer, or assemble them into a Lambda-compatible container image. Check the complete unzipped package or image size against the relevant quota.
- Set executable paths. Configure Selenium with the browser binary and driver paths used by your bundle. The locations depend on how you package them; do not copy paths from an unrelated layer or image.
- Set launch arguments for that build. Configure headless operation and any sandbox or runtime arguments required by the specific Chromium build. Validate the selected flags against the browser and Lambda environment; there is no single official flag list established for every bundle.
- Allocate temporary storage and timeout. Set Lambda’s ephemeral-storage allocation to cover the browser’s scratch needs and output files. Set an invocation timeout and Selenium navigation timeout appropriate to your target pages, within Lambda’s 900-second maximum.
Capture a page with Selenium in Python
This handler shows the capture and cleanup flow. It assumes your deployment bundle supplies a compatible Selenium installation, browser, driver and native dependencies. Replace the executable paths and the browser-specific service/options setup with the locations and launch configuration verified for your bundle. The example returns PNG bytes in the Lambda response as base64-encoded data; it is not a claim that a particular Chromium package or flag set has been tested.
import base64
import os
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
def lambda_handler(event, context):
url = event["url"]
driver = None
options = webdriver.ChromeOptions()
options.binary_location = os.environ["CHROME_BINARY"]
options.add_argument("--headless") # Verify flags for your Chromium build.
service = Service(os.environ["CHROMEDRIVER_PATH"])
try:
driver = webdriver.Chrome(service=service, options=options)
driver.set_page_load_timeout(60)
driver.get(url)
# Add an application-specific readiness check here if the content
# you need is rendered after the page-load event.
png = driver.get_screenshot_as_png()
return {
"statusCode": 200,
"headers": {"Content-Type": "image/png"},
"isBase64Encoded": True,
"body": base64.b64encode(png).decode("ascii"),
}
finally:
if driver is not None:
driver.quit()
Supply CHROME_BINARY and CHROMEDRIVER_PATH as environment variables pointing to the executables in your bundle. Adapt the response integration to the caller: a synchronous Lambda response has payload-size constraints, so for larger output or durable access, upload the PNG to an appropriate storage destination and return a reference instead. Do not treat a file in /tmp as durable storage.
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.
Wait for the right content before capture
Selenium’s driver.get(url) waits for the page-load event, but that does not guarantee that every page has finished rendering the specific content you want. A client-rendered chart, image or delayed component may appear later. Prefer a condition tied to the page’s actual readiness—for example, waiting for a known selector with Selenium’s explicit-wait facilities—rather than relying on a fixed sleep, which can be too short on a slow run and waste time on a fast one. Use set_page_load_timeout to bound navigation; a timeout is a signal to handle or report, not proof that a useful screenshot was captured. See Selenium’s Chrome WebDriver documentation and Chromium WebDriver API.
Save, return or persist the screenshot
Write a PNG file
Use driver.save_screenshot('/tmp/page.png') or driver.get_screenshot_as_file('/tmp/page.png'). Selenium returns True when the file is saved and False for an I/O error. The Lambda /tmp directory is temporary storage associated with an execution environment. AWS notes that it may be available to a reused environment, but it is not a durable place to keep results across invocations. Upload a screenshot that must persist, or include it in the response before the invocation ends. AWS describes Lambda ephemeral storage and states: “Lambda provides ephemeral storage for functions in the /tmp directory.”
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesRank #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.
Return image bytes or base64
Use driver.get_screenshot_as_png() to obtain PNG bytes, as in the handler above, or driver.get_screenshot_as_base64() if the downstream interface specifically requires base64 text. Make sure the receiving integration expects the corresponding content type and encoding.
Store for later access
If a screenshot must be available after the invocation, send it to a durable destination and return a location or identifier. Keep browser scratch files and temporary captures in /tmp; configure Lambda’s ephemeral storage for their combined needs, not as a substitute for persistent storage.
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
Close the browser even when a step fails
Call driver.quit() after capture and in error paths. The finally block in the example ensures cleanup once a driver has been created. Selenium documents quit() as closing the browser and driver executable in its Chromium WebDriver API.
Troubleshoot common failures
- Browser or driver fails to start: Check that both executables exist at the configured paths, are executable, match the selected runtime architecture and are compatible with each other. Confirm that the native shared libraries required by the browser are present in the deployment environment.
- Function reports a missing shared library: The browser bundle’s native dependencies do not match what Lambda provides. Rebuild or package compatible libraries for the chosen runtime and architecture; changing only the Selenium Python package will not supply missing system libraries.
- Navigation hangs or exceeds the function timeout: Set a finite page-load timeout and review the Lambda timeout budget. Slow targets, browser startup and post-load readiness checks all consume invocation time.
- Screenshot is blank or lacks a component: Check whether the target content is rendered after the page-load event. Wait for a page-specific selector or other explicit readiness condition before capture.
- Screenshot file is missing: Confirm the output path is writable and under
/tmp, then check the Boolean result fromsave_screenshotorget_screenshot_as_file. - Result disappears after the invocation: This is expected for temporary storage. Upload the image to durable storage or return it as part of the invocation response.
- Deployment package is rejected or too large: Recalculate the unzipped ZIP and layer contents, or the uncompressed container image size. If the browser bundle does not fit a ZIP deployment, assess a container image and its maintenance requirements.
Or skip the browser setup
If you need a screenshot rather than a Lambda-hosted Selenium browser, ScreenshotNeo offers a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP or PDF. The equivalent basic request is:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →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.
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. Before capture, it accepts cookie or consent banners as a visitor 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 responses identify the page verdict and billing status in headers. 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 with no card; paid plans start at $5 for 3,000 shots.
Sign up for 1,000 free screenshots a month, with no card required.
FAQ
Can a Lambda screenshot survive a warm invocation?
A reused execution environment may retain temporary files, but AWS defines /tmp as ephemeral storage. Do not rely on it for durable delivery; persist the image separately if it must remain available.
Does this example guarantee a screenshot of a fully rendered page?
No. It waits for the browser’s page-load behavior; pages that render important content later need a readiness condition specific to that page.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →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.




