What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use Selenium’s screenshot API after navigating to the page you want to capture. In Python, driver.save_screenshot("artifacts/example.png") writes a PNG of the current browser window and returns True when the write succeeds. Create the destination directory first, check that Boolean result, and always quit the driver in a finally block.
Python: save a browser screenshot to a PNG file
This complete example starts Chrome, opens a page, creates an artifacts directory, saves the visible browser context, checks Selenium’s return value, and closes the session even if navigation or writing fails.
from pathlib import Path
from selenium import webdriver
out = Path("artifacts")
out.mkdir(parents=True, exist_ok=True)
driver = webdriver.Chrome()
try:
driver.get("https://example.com")
ok = driver.save_screenshot(str(out / "example.png"))
if not ok:
raise OSError("Selenium could not write the screenshot")
finally:
driver.quit()
save_screenshot(filename) saves the current window to a PNG. In Python it returns False for an I/O failure, so checking the result prevents a test or batch job from silently reporting success when no file was written. Use a filename ending in .png, and use an explicit path when your process may run from a different working directory.
Using the alternate file method
driver.get_screenshot_as_file("artifacts/example.png") performs the same file-oriented operation. It is useful when you prefer Selenium’s “get” naming convention; the documented file target is a PNG path.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#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.
Capture screenshot data without creating a file
PNG bytes
Use get_screenshot_as_png() when another library, an object store, or an HTTP response should receive the image directly:
png_bytes = driver.get_screenshot_as_png()
with open("artifacts/example.png", "wb") as image:
image.write(png_bytes)
Base64 for HTML or JSON
get_screenshot_as_base64() returns a Base64 string. Embed it in a data URL or put it in a response payload:
encoded = driver.get_screenshot_as_base64()
html = f'<img alt="Browser capture" src="data:image/png;base64,{encoded}">'
Bytes avoid Base64’s size expansion when you control the transport. Base64 is convenient when the receiving format is text-only.
Java: capture with TakesScreenshot
Java exposes screenshots through the TakesScreenshot interface. The target can be a temporary file or a Base64 value. This example copies the temporary source file into a predictable destination and replaces an older file.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
WebDriver driver = new ChromeDriver();
try {
driver.get("https://example.com");
File source = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
Path destination = Path.of("artifacts", "example.png");
Files.createDirectories(destination.getParent());
Files.copy(source.toPath(), destination, StandardCopyOption.REPLACE_EXISTING);
} finally {
driver.quit();
}
OutputType.FILE is appropriate for a normal artifact. Java also supports OutputType.BASE64 when the screenshot must remain text data:
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.
String encoded = ((TakesScreenshot) driver)
.getScreenshotAs(OutputType.BASE64);
The interface can be implemented by a driver and by WebElements, so the same contract covers browser-level and element-level captures where the implementation supports it.
Capture one element instead of the whole window
Locate the component, then call the element screenshot method exposed by your language binding. In Python:
from pathlib import Path
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
try:
driver.get("https://example.com")
card = driver.find_element(By.CSS_SELECTOR, "main")
Path("artifacts").mkdir(exist_ok=True)
if not card.screenshot("artifacts/main.png"):
raise OSError("Element screenshot was not written")
finally:
driver.quit()
Element capture is useful for a component regression test or documentation image because it excludes browser chrome and unrelated page content. The selector must identify the intended element, and the driver must support element screenshots.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteFull-page screenshots and driver differences
A regular save_screenshot call means the current window or visible browser context; it does not guarantee a capture of the entire document. Full-document behavior is driver-specific. Firefox’s Python API documents a dedicated method:
from pathlib import Path
from selenium import webdriver
driver = webdriver.Firefox()
try:
driver.get("https://example.com")
Path("artifacts").mkdir(exist_ok=True)
if not driver.get_full_page_screenshot_as_file("artifacts/full.png"):
raise OSError("Full-page screenshot was not written")
finally:
driver.quit()
If you need full-page output on another browser, verify that browser’s Selenium driver capability rather than assuming Firefox’s method is portable. A fallback is to capture the visible viewport repeatedly while scrolling and stitch the images yourself, but stitching must account for fixed headers, overlapping regions, lazy-loaded content, and device scale.
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.
Make captures deterministic
Wait for the page state you need
driver.get() returning means navigation completed according to the browser’s load strategy, not that every application-rendered widget is ready. Use an explicit wait for a meaningful element before capturing:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
WebDriverWait(driver, 20).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, "main"))
)
For charts, animations, or images, wait for the application’s ready condition. A fixed sleep can be acceptable for a deliberately timed visual effect, but explicit conditions usually reduce flaky tests.
Control viewport and scaling
Set a known window size before navigation when pixel dimensions matter:
driver.set_window_size(1440, 900)
Headless and headed sessions can render different fonts, scrollbars, and device-pixel ratios. Pin the browser version and driver in continuous integration, install the same fonts, and avoid comparing captures produced under different scale settings.
Control dynamic content
- Dismiss or mask cookie dialogs when they are not part of the test subject.
- Disable rotating carousels and animations where your test environment allows it.
- Use stable test data and a fixed locale, timezone, and viewport.
- For lazy-loaded sections, scroll them into view and wait for their images before a full-document capture.
Common errors and fixes
No file appears
Confirm the parent directory exists, the process has write permission, and the path is resolved where you expect. Check the Boolean result from save_screenshot or the element method; do not ignore a False return.
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
The image shows a blank or incomplete page
Capture only after the relevant element is visible and application data has loaded. Check that navigation did not end on an authentication, bot-check, or error page. In headless CI, verify window size and installed fonts.
Recommended Free Tools
Only the viewport is captured
That is expected for a normal driver screenshot. Use a documented full-page capability for your driver, such as Firefox’s get_full_page_screenshot_as_file, or implement a scroll-and-stitch fallback.
Element capture fails
Wait for the element, ensure the selector matches one intended node, and check driver support for WebElement screenshots. An element outside the document or covered by a transient overlay may need scrolling or overlay dismissal first.
Java throws a file or path exception
Create the destination directory with Files.createDirectories, then copy the temporary OutputType.FILE result. Keep the driver alive until the copy completes.
Performance, reliability, and cost considerations
The official Selenium API references used for these methods do not publish a stable capture-time, success-rate, or image-quality benchmark. Treat screenshot cost as your browser session’s CPU, memory, storage, and execution time rather than relying on an undocumented speed figure. Reuse a driver for a controlled batch when isolation permits, but create a fresh session when cookies, local storage, or extensions could contaminate the next capture. Save artifacts with unique names in parallel jobs, and retain the URL, viewport, browser version, and test identifier beside each image so failures can be reproduced.
Free tools Windows power users keep installed
One-click scans. No signup required.
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.
Or skip the browser setup
For a hosted one-call capture, ScreenshotNeo accepts a URL and returns a PNG, JPEG, WebP, or PDF. It accepts the consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status.
See the parameter reference in the ScreenshotNeo documentation. A cURL request is:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also provides full-page and CSS-selector captures, dark mode, device presets or custom viewports, retina scale, PDF controls, custom CSS and JavaScript, click and wait actions, request blocking, headers, cookies, user-agent, authorization, timezone, geolocation, transparent backgrounds, resizing, configurable caching, signed image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, an OpenAPI specification, and an MCP server with take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. Every feature is available on every plan. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots, with yearly billing providing two months free. Create a free ScreenshotNeo account.
Quick decision guide
| Need | Best Selenium approach | Important limitation |
|---|---|---|
| Visible browser image | Python save_screenshot or Java TakesScreenshot |
Captures the current window/context |
| Element-only image | WebElement screenshot method | Requires driver and element support |
| Full document | Driver-specific full-page API | Support differs by browser |
| In-memory transport | PNG bytes or Base64 | Base64 is text and increases payload size |
Frequently Asked Questions
Can Selenium save JPEG or WebP directly?
The documented Python file methods and the Java file example produce PNG output. Convert the PNG with an image library if another format is required.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Does taking a screenshot wait for network idle?
No. Selenium captures when your command runs. Add an explicit wait for the page state your test requires.
Can I capture a screenshot before quitting the driver?
Yes. The capture and file or byte transfer must finish before driver.quit(); quitting first ends the browser session.
Why is my screenshot different in CI?
Browser version, fonts, viewport size, device scale, locale, animations, and data can differ. Pin those inputs and wait for stable content.
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.

