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

Use Selenium to open the page, set a deliberate browser size, wait for the content you need, and save a screenshot. In Python, driver.save_screenshot("thumbnail.png") captures the current browser view as a PNG. That is a viewport screenshot—not automatically an image of the entire page.

Capture a website thumbnail in Python

This runnable example uses headless Chrome, sets a 1280 × 800 viewport, waits for a visible heading, and writes a PNG file. Replace the example URL and wait condition with the page and content your thumbnail requires.

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait

options = webdriver.ChromeOptions()
options.add_argument("--headless")

driver = webdriver.Chrome(options=options)
try:
    driver.set_window_size(1280, 800)
    driver.get("https://example.com")

    # Replace this with a condition that represents the content you need.
    WebDriverWait(driver, 10).until(
        lambda d: d.find_element("tag name", "h1").is_displayed()
    )

    driver.save_screenshot("thumbnail.png")
finally:
    driver.quit()

The example assumes Selenium and a compatible Chrome/ChromeDriver setup are available. Selenium’s Python API documents save_screenshot(filename) as saving a PNG of the current window; it returns False if an I/O error occurs. Use a full output path if you need to control exactly where the file is written.

Choose what to capture

Current browser view

driver.save_screenshot("thumbnail.png") captures the current browsing context as it appears in the browser window. Window dimensions determine the framing, so set them before navigation or capture. A screenshot of a 1280 × 800 window is not necessarily the same thing as a thumbnail resized to 1280 × 800; it is a capture made at that browser size.

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.

One element

For a card, hero image, or other specific region, locate the element and call its screenshot method instead of capturing the whole viewport:

element = driver.find_element("css selector", ".hero-card")
element.screenshot("element.png")

The selector must match an element on the page. Element screenshot behavior depends on the browser implementation, so check the resulting image in the browser and environment you intend to use.

The full document

Do not assume a standard viewport screenshot includes content below the fold. Full-page capture is a separate requirement. For Chrome, the DevTools Protocol’s Page.captureScreenshot supports clipping and the captureBeyondViewport parameter, which defaults to false in its protocol reference. Selenium’s Python Chromium driver exposes execute_cdp_cmd() for sending Chrome DevTools Protocol commands.

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.

These commands are Chrome-specific, not a portable Selenium screenshot method. The protocol supported by your installed Chrome and Selenium combination can vary; consult the Chrome DevTools Protocol Page reference and verify behavior in your setup.

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

Wait for the right visual state

Selenium Python’s get() waits for the page’s onload event, but that does not guarantee that a modern page has finished changing. JavaScript, images, and other asynchronous content may still be loading or updating. The example waits for a visible heading as a simple illustration, not as a universal readiness test.

Choose a condition that reflects the content you need in the screenshot, such as a particular element becoming visible or an application-specific state becoming available. A generic sleep may be easier to add, but can be too short on a slow run and unnecessarily long on a fast one. Validate the wait condition against representative pages and the environment where the script will run.

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.

Control viewport size and output

  • Set the browser window: Selenium’s set_window_size(width, height) lets you choose the screenshot framing. Choose dimensions deliberately for the intended preview.
  • Headless Chrome sizing: Chrome’s headless examples use --window-size=1280,1696 as an example. Those dimensions are an illustration, not a recommended universal thumbnail size.
  • Save formats: Selenium Python’s documented save_screenshot() flow writes PNG. Its API also provides screenshot bytes and base64 output.
  • Chrome protocol formats: Chrome DevTools Protocol lists PNG, JPEG, and WebP; its quality parameter is documented for JPEG. These protocol options are Chrome-specific.

Chrome’s headless command-line option --screenshot can write screenshot.png to the current working directory, but Chrome’s documentation notes that full-page screenshots require more than that basic command. For a Selenium workflow, using the WebDriver screenshot API keeps navigation, waits, and capture in the same script.

Handle common problems

The image cuts off lower-page content

The basic screenshot captures the browser view, not necessarily the whole document. If you need the entire page, use an appropriate full-page method. Chrome’s beyond-viewport and clipping controls are DevTools Protocol features; check the protocol version supported by your installed browser and driver.

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

The screenshot is blank or missing content

Navigation completing at onload does not establish that every asynchronous component is ready. Wait for the specific content or stable application state needed in the image, then inspect the output. If the target element never appears, check that the selector matches the page and that the page reached the expected state.

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

The framing is wrong

Set the window dimensions explicitly before capture and confirm that the resulting viewport matches your intended layout. A page can reflow at different widths, so changing dimensions may change what is visible as well as the image size.

The PNG was not written

Check the output path and permissions. Selenium’s Python method returns False on an I/O error; using a full path can avoid confusion about the process’s current working directory.

Chrome-specific capture behaves differently after an update

DevTools Protocol capabilities are tied to Chrome implementation and version. Confirm the installed Chrome and Selenium combination supports the command and parameters you use; do not assume the protocol call works identically across browser engines.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. Its API takes one GET request with a URL and returns an image or PDF. For a WebP screenshot, see the ScreenshotNeo API documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

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 or 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 for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month without a card.

Frequently Asked Questions

Can Selenium save a screenshot as a JPG or WebP?

The documented Python `save_screenshot()` method writes PNG. Chrome’s DevTools Protocol lists JPEG and WebP as well as PNG; those format controls are Chrome-specific.

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

Does Selenium’s `get()` wait until every image and script has finished?

No. It waits for the page’s `onload` event in Python, but asynchronous page changes can continue afterward. Wait for the content or application state your capture depends on.

Can I use the Chrome full-page capture method in Firefox?

The DevTools Protocol approach described here is Chrome-specific. The cited documentation does not establish equivalent behavior across browser engines.

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.