Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsCall driver.save_screenshot("page.png") only after Selenium has reached the readiness condition your image needs. A normal driver.get() waits for document readiness by default, but pages that render content later with JavaScript need an explicit wait for that content.
Capture after the right loading condition
For a static page, Selenium’s default navigation behavior is often enough: with the normal page-load strategy, navigation waits until the document’s readyState is complete. That does not guarantee that a single-page app, API-backed result, or other asynchronously updated component has finished rendering. For those pages, wait for a page-specific condition that represents what should appear in the screenshot.
As an Amazon Associate I earn from qualifying purchases.
The example below waits for a results element to become visible, then saves the current browser window as a PNG. The selector and 15-second timeout are examples; replace them with a locator and timeout appropriate to the site.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
with webdriver.Chrome() as driver:
driver.get("https://example.com")
# Replace this selector with an element that appears when the content is ready.
WebDriverWait(driver, 15).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, "main .results"))
)
driver.save_screenshot("page.png")
Selenium’s official Browser Options and Waiting Strategies documentation distinguish document loading from later application updates. The Python API documents save_screenshot() as saving the current window to a PNG file; use get_screenshot_as_png() if you need the screenshot as binary image data instead of writing a file directly (Selenium Python WebDriver API).
#1 Best Overall
What Selenium means by “page loaded”
Default: normal
The default normal strategy waits for the document readiness state complete during URL navigation. Selenium’s options guide says this waits for resources to download, but a modern application may continue changing the page afterward. Use the default when the elements you need are present by document readiness.
Alternative navigation thresholds: eager and none
The session-level eager strategy returns at the interactive / DOMContentLoaded threshold, while some resources, including images, may still be loading. none does not block navigation on document readiness. These options change when navigation returns; they do not confirm that a particular widget, image, or application update is ready for capture. Even with either strategy, wait explicitly for the application state you need.
Rank #2
Choose a wait that matches the screenshot
- Static page: Rely on the default navigation wait if the desired content exists by document readiness, then capture.
- Single-page app or API-backed content: Wait for the relevant element to appear or become visible before capture.
- After a click: Wait for the resulting state or element, rather than assuming the click itself means the update has finished.
- Images or other specific assets: Choose an observable condition that indicates the asset you need is ready. Document readiness alone may not cover later application activity.
An explicit wait polls for its condition until it succeeds or times out. This is generally more reliable than inserting an arbitrary fixed sleep because the capture is tied to an observable page state, not an assumed duration.
Timeouts and common failures
The explicit wait times out
A timeout means Selenium did not observe the requested condition within the allotted time. Check that the locator matches the current page, that the element is expected to become visible rather than merely exist, and that navigation or an overlay has not changed the relevant context. Increase the timeout only if the page legitimately needs more time; a longer timeout will not correct a wrong locator or condition.
Navigation raises a page-load timeout
A page-load timeout limits how long the driver waits for navigation. It is not a signal that asynchronous application work is complete. Decide separately what navigation threshold is acceptable and what page-specific condition the screenshot requires.
The screenshot is missing late content
If the image is captured after driver.get() but before a JavaScript-driven update, add an explicit wait for the intended result or state. Avoid treating a shorter navigation threshold such as eager or none as a substitute for that wait.
Wait durations behave unpredictably
Selenium warns that combining implicit and explicit waits can lead to unpredictable wait durations. For this workflow, use a targeted explicit wait for the screenshot condition instead of mixing wait styles casually.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Or skip the browser setup
If you need an image from a URL without managing a Selenium browser session, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a screenshot or PDF. Here is a cURL example; see the ScreenshotNeo API documentation for request options.
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
- It accepts cookie and 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 are not billed. Responses include
X-Page-VerdictandX-Billedheaders. - Its MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for AI agents and MCP clients. - The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month without a card.
Frequently Asked Questions
Does Selenium wait for the page to load before taking a screenshot?
With the default `normal` strategy, URL navigation waits for document readiness to reach `complete`. A JavaScript application may still update afterward, so wait for the content you need.
Should I use `time.sleep()` before saving a screenshot?
A fixed sleep is not tied to page state. Use an explicit wait for the relevant element or condition so capture proceeds when that condition succeeds or reports a timeout.
Free tools Windows power users keep installed
One-click scans. No signup required.
Can Selenium save a screenshot as something other than a PNG file?
The documented `save_screenshot()` method writes a PNG file. `get_screenshot_as_png()` returns binary PNG data; the cited Python API does not establish other output formats for these methods.
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.




