For Chrome, the most reliable Selenium Python solution is to call Chrome DevTools Protocol’s Page.captureScreenshot with PNG output and captureBeyondViewport enabled. If your Chrome/CDP version does not honor that parameter, measure the document, resize the window, and capture again. Extremely tall, animated, or lazy-loaded pages may require scrolling and stitching viewport tiles.
What Selenium captures by default
driver.get_screenshot_as_file("viewport.png") and driver.save_screenshot("viewport.png") save the current browser window as a PNG. They are viewport captures: content below the visible area is not automatically included. A full-document workflow must explicitly capture beyond the viewport, resize the browser to the document, or assemble several screenshots.
The older Selenium Python bindings document get_full_page_screenshot_as_file(), get_full_page_screenshot_as_png(), and get_full_page_screenshot_as_base64() as full-document methods associated with Firefox behavior. Do not assume that ChromeDriver implements those methods in the same way. For Chromium, use CDP first and keep the resize fallback available.
Prerequisites and a minimal ChromeDriver session
- Python with the Selenium package installed:
python -m pip install -U selenium. - Google Chrome and a compatible ChromeDriver (or Selenium Manager able to obtain one).
- A URL that your test environment can reach, plus any cookies, authentication, headers, or viewport requirements the page needs.
This is a complete starting point. Add an application-specific wait before taking the image; navigation finishing does not necessarily mean that the page’s meaningful content, fonts, or lazy images are ready.
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 minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall#1 Best Overall
- 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
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
# options.add_argument("--headless=new") # uncomment for headless runs
# options.add_argument("--window-size=1440,900")
driver = webdriver.Chrome(options=options)
driver.get("https://example.com")
# Wait for your page's meaningful content here.
In production, use a try/finally block (or a context-management pattern) so Chrome is closed even when capture fails.
Method A: capture the complete page through CDP
Selenium’s Chromium driver exposes Chrome DevTools Protocol commands through execute_cdp_cmd. The following routine asks Chrome for a PNG that extends beyond the viewport and decodes the returned base64 payload.
import base64
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.get("https://example.com/long-page")
# Replace this comment with an explicit wait for application content.
result = driver.execute_cdp_cmd(
"Page.captureScreenshot",
{
"format": "png",
"captureBeyondViewport": True,
"fromSurface": True,
},
)
with open("full-page.png", "wb") as image_file:
image_file.write(base64.b64decode(result["data"]))
finally:
driver.quit()
What the parameters do
format: "png"requests lossless PNG output. CDP also supports other formats in compatible versions, but PNG is the straightforward choice for test artifacts.captureBeyondViewport: Trueasks Chrome to include content outside the visible viewport. Support and behavior are CDP-version-sensitive.fromSurface: Truecaptures the rendered surface rather than relying only on the visible viewport.
If the resulting file is still only viewport-sized, inspect the protocol supported by the installed Chrome and use Method B. Chrome, ChromeDriver, Selenium, and CDP evolve independently, so check the deployed versions together rather than assuming a parameter is available everywhere.
Method B: resize Chrome to the document dimensions
When CDP capture is unavailable or ignores beyond-viewport capture, read the document’s dimensions with JavaScript, resize the browser, and use Selenium’s ordinary PNG method.
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.get("https://example.com/long-page")
width = driver.execute_script(
"return Math.max(document.body.scrollWidth, "
"document.documentElement.scrollWidth);"
)
height = driver.execute_script(
"return Math.max(document.body.scrollHeight, "
"document.documentElement.scrollHeight);"
)
driver.set_window_size(width, height)
# Wait here for fonts, images, and lazy content after the resize.
driver.get_screenshot_as_file("full-page.png")
finally:
driver.quit()
Limits of window resizing
The requested dimensions can be constrained by browser chrome, device-pixel-ratio limits, maximum bitmap dimensions, and differences between headed and headless modes. A page can also change its layout after the resize. Re-measure if your application reacts to viewport width, and verify the saved image’s dimensions in the pipeline that consumes it.
Rank #2
- 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
When a single bitmap is too large: scroll and stitch
Very long pages can exceed Chrome or image-library bitmap limits. In that case, capture consistent viewport-height tiles while scrolling and combine them with an image library such as Pillow. Hide or account for fixed and sticky elements first; otherwise a sticky header may appear in every tile. Use the same viewport width, scale, and wait interval for every tile, and remove the overlap introduced by the final partial viewport.
A tile strategy is also useful when a page’s lazy loader only fetches content as it approaches the viewport. Scroll through the page once to trigger loading, wait for images to settle, then capture the tiles. Stitching is more work than CDP or resizing, but it avoids one enormous bitmap and gives you control over memory use.
Make dynamic pages capture-ready
Wait for application readiness
Replace a fixed sleep with a condition that represents your page’s usable state, such as a results container becoming visible or a loading indicator disappearing. A navigation event only confirms that the initial document response completed.
Load lazy content before measuring
Images using lazy loading may not contribute their final height until they are near the viewport. Scroll through the document, wait for image completion, and then measure or invoke CDP capture. If the page continuously appends content, define a stopping condition so the capture does not run forever.
Freeze motion for visual tests
Animations, carousels, blinking cursors, and video can make two captures differ. Inject test-only CSS that disables transitions and animations, or wait for a stable frame. Do not disable motion if the behavior itself is what you are testing.
Handle fixed and sticky elements
Fixed navigation can cover content in a resized screenshot; sticky elements can repeat in stitched tiles. Temporarily hide them with a CSS class or compensate for their height in your stitching code, depending on whether they are part of the expected result.
Reproduce the real session
Set the required viewport width before navigation. Add cookies or authentication, custom headers, and the intended user agent before loading the page. Consent dialogs can change layout, so establish the expected consent state before measuring.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- 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.
Choosing between the two Selenium methods
| Situation | Recommended approach | Reason |
|---|---|---|
| Modern Chromium and a normal-length page | CDP Page.captureScreenshot |
One command can capture beyond the viewport without changing page layout. |
| CDP parameter unsupported or output remains viewport-sized | Resize to document dimensions | Uses standard Selenium screenshot APIs after explicitly enlarging the window. |
| Extremely tall document or bitmap-limit errors | Scroll, capture tiles, and stitch | Controls memory and avoids a single oversized image. |
| Pixel-comparison test | Any method plus deterministic waits and motion control | Timing, fonts, lazy assets, and animations affect pixels more than the API choice. |
Troubleshooting common failures
The image contains only the viewport
Cause: the ordinary Selenium screenshot method was used, or Chrome ignored captureBeyondViewport.
Fix: use the CDP example exactly, verify the returned dimensions, and fall back to document-size resizing. For oversized pages, use tiles.
unknown command or CDP parameter errors
Cause: Chrome, ChromeDriver, Selenium, and the protocol are not aligned, or the deployed Chrome version does not support that parameter.
Fix: update or pin the three installed components as a compatible set, then consult the protocol supported by that Chrome. Keep Method B as a compatibility path.
Images or sections are missing
Cause: lazy loading, asynchronous rendering, blocked resources, or an early capture.
Fix: wait for the page’s ready condition, scroll to trigger lazy assets, wait for image completion, and confirm that required cookies and authentication were supplied.
Content is covered or duplicated
Cause: fixed or sticky elements.
Fix: hide them for the capture when they are not part of the assertion, or account for their height and repeated appearance when stitching.
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 minuteThe process hangs or Chrome remains running
Cause: an exception bypassed cleanup or the page never reaches its application-ready state.
Fix: put capture code in try/finally, set sensible waits and timeouts, and define a failure path for pages that keep loading.
The file is unexpectedly huge or fails to save
Cause: a very large CSS pixel area multiplied by device-pixel ratio can exceed browser or filesystem limits.
Fix: reduce the capture scale where your test permits, use tiles, and verify available disk space and output dimensions.
Rank #4
- 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
Reliability, performance, and cost considerations
- Repeatability: fix the viewport, locale, timezone, authentication state, and data set. Dynamic advertisements and timestamps can otherwise change every image.
- Speed: CDP avoids a resize and is usually the shortest path for ordinary pages. Waiting for lazy assets and fonts is often the dominant cost.
- Memory: one full-page PNG keeps a large bitmap in Chrome and Python. Tile capture lowers peak memory but adds stitching work.
- Validation: check that the file exists, opens successfully, and has expected width and height. Treat a zero-byte or viewport-only file as a failed artifact.
- Maintenance: keep Chrome, ChromeDriver, Selenium, and CDP behavior under version control in CI, and re-check the capture when upgrading any one of them.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server when you need a clean page image without maintaining ChromeDriver. Before capture it accepts cookie or consent banners 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 are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.
One GET request returns PNG, JPEG, WebP, or a PDF. The API supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets or custom viewports, retina scale, PDF paper and page options, custom CSS and JavaScript, pre-capture clicks, selector waits, delay or network-idle waits, request and resource blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs are accepted to ease migration.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
It also includes MCP tools named take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
cURL
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}`);
See the ScreenshotNeo documentation for request options. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account to try it.
FAQ
Does get_full_page_screenshot_as_file() work with ChromeDriver?
It is documented in older Selenium Python bindings and associated with Firefox behavior. For Chrome, use Chromium CDP or the resize fallback instead of assuming that method is implemented.
Can I save JPEG or WebP with the Selenium CDP example?
The example requests PNG. CDP supports additional formats in compatible Chrome versions; confirm the supported parameters for the Chrome deployed in your test environment before changing the format.
Recommended Free Tools
Best Value
- 【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.
Why does a full-page screenshot differ between headed and headless Chrome?
Viewport metrics, device-pixel ratio, font availability, and browser rendering conditions can differ. Pin the mode and dimensions used by your tests and compare artifacts produced under the same environment.
Frequently Asked Questions
Does get_full_page_screenshot_as_file() work with ChromeDriver?
It is documented in older Selenium Python bindings and associated with Firefox behavior. For Chrome, use Chromium CDP or the resize fallback instead of assuming that method is implemented.
Can I save JPEG or WebP with the Selenium CDP example?
The example requests PNG. CDP supports additional formats in compatible Chrome versions; confirm the supported parameters for the Chrome deployed in your test environment before changing the format.
Why does a full-page screenshot differ between headed and headless Chrome?
Viewport metrics, device-pixel ratio, font availability, and browser rendering conditions can differ. Pin the mode and dimensions used by your tests and compare artifacts produced under the same environment.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →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.

