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

A black Selenium screenshot in headless Chrome has no single documented fix: first determine whether the image was saved correctly, then isolate headless mode, browser/driver versions, viewport size, and page readiness one variable at a time. The steps below help identify which part of your setup is failing rather than relying on a flag that may not apply to your Chrome version or operating system.

1. Check whether Selenium actually saved the screenshot

In Python, save_screenshot() saves the current window as a PNG and returns False if there is an I/O error. Check that return value and open the file at the path you expect. A successful return confirms the save operation, not that Chrome rendered the page correctly.

saved = driver.save_screenshot("capture.png")
print("Screenshot saved:", saved)
  • If the result is False, check the output path, directory permissions, and whether the directory exists.
  • If it is True but the image is black, the file write succeeded; continue by isolating the browser session and capture state.

Selenium’s Python Chrome WebDriver API documents the screenshot method and its return value.

2. Isolate whether the problem is specific to headless mode

Capture the same page with the same Chrome and ChromeDriver in headful mode, changing no other setting. This is a diagnostic comparison, not a claim that headful mode is inherently more reliable. If the headful capture is also black, investigate the page, timing, viewport, and file handling before focusing on headless-specific settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

When testing alternatives, change one variable per run and keep the page, browser, driver, and output path constant. Useful comparisons include headless versus headful, new versus legacy Headless when both are available, and default versus explicit viewport dimensions.

3. Record Chrome, ChromeDriver, Selenium, and platform details

Before changing flags, record the Chrome version, ChromeDriver version, Selenium version, operating system, and whether Chrome is running in a container. Selenium’s Chrome documentation says Selenium 4 is compatible with Chrome 75 and later, and Chrome and ChromeDriver must have matching major versions. Check the versions in the failing environment, not just on a development machine.

Chrome’s Selenium Chrome documentation describes the browser/driver compatibility requirement. If their major versions do not match, correct that first and repeat the same capture before testing other changes.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

4. Check which Headless Chrome implementation is in use

Chrome’s newer Headless implementation arrived in Chrome 112 and uses the regular Chrome browser code. Chrome documents --headless=new as the way to opt into it from Selenium. Older Headless was a separate implementation with its own bugs and feature differences, so behavior and supported flags are not interchangeable across every Chrome release.

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

If the installed Chrome release supports the new mode, try it as a controlled test:

options.add_argument("--headless=new")

Do not assume this argument is valid or behaves identically in every release. Check the installed version and Chrome’s Headless documentation before treating it as a fix. The Chrome team explains that Headless creates browser windows without displaying platform windows; an invisible window does not by itself mean the page has finished rendering.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

5. Make the viewport and page readiness explicit

Selenium captures the current browser window. Set its size deliberately, navigate to the target page, and wait for the application state you need before taking the screenshot. A page-load event may not mean a JavaScript-heavy application, image, or chart is ready, so use a wait appropriate to that site rather than an arbitrary short delay.

Chrome’s command-line screenshot options document --window-size and --timeout for controlling capture dimensions and delaying a command-line capture after loading. They are useful clues for what to make explicit in a Selenium workflow, but are not Selenium-specific guarantees.

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

6. Starting-point Python example

This minimal example combines the documented Headless argument, an explicit window size, and Selenium’s screenshot call. It is a starting point, not a tested recipe for every Chrome, Selenium, application, or operating-system combination. Add an application-specific readiness wait where the page needs one.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("--headless=new")

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

    # Add an application-specific readiness wait when needed.
    saved = driver.save_screenshot("capture.png")
    print("Screenshot saved:", saved)
finally:
    driver.quit()

If your installed Chrome does not support --headless=new, consult its documentation for the Headless mode available in that release rather than blindly substituting flags.

7. Inspect the invisible browser with remote debugging

If the file is valid but still black, use Chrome’s documented --remote-debugging-port option to inspect the Headless session. This can help establish whether the expected page loaded and what state the browser reached before the screenshot. Remote debugging is a diagnostic aid, not a cure for a rendering problem.

Chrome documents remote debugging alongside its Headless command-line controls in the Headless documentation. Keep debugging access limited to trusted local environments; do not expose a debugging port publicly.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

8. Treat --disable-gpu as dated, platform-specific advice

Chrome’s Headless FAQ says --disable-gpu was needed only on Windows according to that page, calls it a temporary workaround for some bugs, and says other platforms no longer require it. The FAQ was last updated April 27, 2017, so this is dated guidance—not a current universal remedy for black screenshots. Test it only when the platform and browser context make that old advice relevant, and compare against an otherwise identical run.

The same FAQ says Headless Chrome does not need Xvfb. That page’s age matters: avoid adding Xvfb or GPU flags by default based solely on old setup recipes. See Chrome’s Headless FAQ.

9. Common symptoms and next steps

Symptom What to check next
save_screenshot() returns False Check the destination path, directory permissions, and whether the output directory exists.
It returns True, but the PNG is black Compare headful and headless captures; record browser and driver versions; then test page readiness and explicit dimensions.
Only one page is affected Wait for that page’s actual ready state before capture and inspect the session through remote debugging.
The issue began after a browser or driver change Record both versions and verify that Chrome and ChromeDriver have matching major versions.
A suggested flag has no effect or is rejected Check whether the installed Chrome release supports that flag and mode; do not treat older Headless and new Headless as equivalent.
The issue occurs in a container or only on a particular OS Include the OS/container details in the reproduction and test one platform-specific change at a time. The cited guidance does not establish one fix for every environment.

Or skip the browser setup

If your goal is a screenshot rather than debugging a Selenium browser session, ScreenshotNeo offers a one-request screenshot API. It accepts cookie or 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 are not billed, and responses identify the page verdict and billing status in headers. It also provides an MCP server with screenshot tools for AI agents.

For an API key and the available parameters, see the ScreenshotNeo documentation.

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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo returns PNG, JPEG, WebP, or PDF output. The call above saves WebP output to shot.webp; use the API documentation for output-format options. One thousand screenshots per month are free with no card; paid plans start at $5 for 3,000 screenshots. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.

What to include when asking for help

For a specific diagnosis, include the Chrome, ChromeDriver, and Selenium versions; operating system and container details; the exact headless arguments; whether headful capture works; the screenshot return value; and a minimal reproduction with the page and readiness condition. There is no published frequency or single confirmed cause for black Selenium screenshots in the cited official documentation, so these details are needed to distinguish environment-specific failures.

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.