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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Wait for the page state your screenshot actually needs, not an arbitrary delay. In Selenium Python, use WebDriverWait with an expected condition such as a visible report container, then call save_screenshot(). A navigation reaching readyState="complete" does not guarantee that JavaScript-rendered content, charts, or images are ready. PhantomJS can still be relevant to an old, pinned system, but its upstream project is archived and suspended; use a maintained headless Chrome or Firefox driver for new automation.

The reliable waiting pattern

This example opens a page, waits up to 15 seconds for the content that must appear in the image, saves a PNG, and always closes the browser:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait

url = "https://example.com"
driver = webdriver.Chrome()
try:
    driver.get(url)
    WebDriverWait(driver, 15).until(
        EC.visibility_of_element_located((By.CSS_SELECTOR, "main .report"))
    )
    driver.save_screenshot("page.png")
finally:
    driver.quit()

Replace main .report with a selector that identifies the completed state on your site. Selenium’s Expected Conditions include presence and visibility checks, while WebDriverWait polls until the condition succeeds or its timeout expires. The Selenium Python quick reference documents save_screenshot for PNG output: https://selenium.io/cheatsheet/python.

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

Why waiting for navigation is insufficient

driver.get() returns after the configured page-load strategy reaches a readyState value; the default is complete. That describes navigation and assets known to the document, not every later mutation made by JavaScript. Single-page applications may fetch data, replace loading markup, render a chart, or lazy-load images after navigation has returned. Selenium explains these navigation and waiting behaviors in its Waiting Strategies guide.

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

A fixed time.sleep(3) can be too short on a slow run and waste time on a fast one. An explicit wait finishes as soon as the required state exists and stops at a bounded deadline. Use a sleep only for a deliberate, page-specific animation interval after the meaningful condition has already been met.

Choose a condition that matches the screenshot

Element exists in the DOM

Use presence_of_element_located when the element’s existence is enough, even if it is not visible. This is useful for hidden state markers or a server-rendered shell, but it may capture an empty or covered element.

WebDriverWait(driver, 15).until(
    EC.presence_of_element_located((By.ID, "data-ready"))
)

Element is displayed

Use visibility_of_element_located when the screenshot must show the element. Visibility means Selenium can find it and it has a displayed size; it does not prove that text, images, or a chart inside it has finished rendering.

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.
WebDriverWait(driver, 15).until(
    EC.visibility_of_element_located((By.CSS_SELECTOR, "main .report"))
)

Specific text or a loading state

Wait for a meaningful label, or wait until a spinner disappears. Text conditions are useful when the same container exists before and after an AJAX update.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
WebDriverWait(driver, 20).until(
    EC.text_to_be_present_in_element(
        (By.CSS_SELECTOR, "#status"), "Complete"
    )
)
WebDriverWait(driver, 20).until(
    EC.invisibility_of_element_located((By.CSS_SELECTOR, ".loading-spinner"))
)

A page-specific custom condition

For a chart or data table that changes in place, return a truthy value only when the final state is observable. The callable below waits for a non-empty table and at least one data row:

def table_has_rows(driver):
    table = driver.find_element(By.CSS_SELECTOR, "table.results")
    rows = table.find_elements(By.CSS_SELECTOR, "tbody tr")
    return table if rows else False

WebDriverWait(driver, 30).until(table_has_rows)

Custom conditions are preferable to guessing how long a request will take. Keep the condition deterministic and tied to something a user would recognize in the screenshot.

Timeouts, polling, and failure handling

WebDriverWait(driver, timeout) takes seconds. Its Python API default polling interval is 0.5 seconds; until() returns the callable’s truthy value and raises TimeoutException if the deadline passes. See the API reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
from selenium.common.exceptions import TimeoutException

try:
    WebDriverWait(driver, 20).until(
        EC.visibility_of_element_located((By.CSS_SELECTOR, "main .report"))
    )
except TimeoutException:
    driver.save_screenshot("timeout-debug.png")
    raise

Choose the timeout from real page behavior: long enough for the slow end of normal operation, but finite so a broken request cannot hang a batch forever. On expiration, log the URL and condition, optionally preserve a diagnostic screenshot or HTML, then skip or retry according to the job’s requirements.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Do not mix implicit and explicit waits

Selenium warns, “Do not mix implicit and explicit waits.” An implicit wait changes every element lookup, while an explicit wait repeatedly evaluates one condition. Combining them can make each poll inherit the implicit delay and produce unpredictable total times. Prefer explicit waits for capture readiness and leave the implicit wait at its default of zero. Guidance is in Selenium’s waiting documentation.

Making the capture deterministic

  • Use a stable selector: Prefer an ID, data attribute, or dedicated state class over a fragile position-based XPath.
  • Wait for the visual result: A visible wrapper may still contain an empty canvas; wait for a row count, status text, or application flag when necessary.
  • Control viewport and window size: Set a known size before navigation so responsive breakpoints do not change between runs.
  • Handle lazy content: Scroll or wait for the lazy-loaded region before capturing a full page.
  • Keep cleanup in finally: A failed wait should not leave browser processes consuming memory.
  • Capture diagnostics: On a timeout, retain a debug image and exception details rather than silently producing a misleading screenshot.

PhantomJS: what legacy users need to know

PhantomJS was a headless WebKit browser with screen-capture support, but its upstream README says development is suspended and the repository is archived and read-only. The project identifies 2.1 as its latest stable line, with 2.1.1 described as the last known stable release in the archiving notice: project repository and archiving notice.

Selenium’s JavaScript binding history records removal of native PhantomJS support and directs users toward headless Chrome or Firefox: change history. That record is specific to the JavaScript binding, not a complete Python compatibility matrix. Current Selenium documentation does not establish which modern Python/Selenium combinations work with a legacy PhantomJS binary.

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

If you must maintain an existing PhantomJS deployment, pin the exact Selenium, Python, PhantomJS, and operating-system dependencies already used by that application, run the suite in that environment, and document the result. Do not assume that a current Selenium release will support it. For new work, use a maintained Chrome or Firefox driver in headless mode and apply the same explicit-wait logic.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

Illustrative legacy PhantomJS setup

The following shows the historical shape of a PhantomJS driver configuration; it is not a claim of current compatibility. Test it only with the versions your legacy system has pinned:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait

# Requires a separately installed, pinned PhantomJS binary and compatible Selenium.
driver = webdriver.PhantomJS(executable_path="/path/to/phantomjs")
try:
    driver.get("https://example.com")
    WebDriverWait(driver, 15).until(
        EC.visibility_of_element_located((By.CSS_SELECTOR, "main .report"))
    )
    driver.save_screenshot("legacy-page.png")
finally:
    driver.quit()
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common problems and fixes

TimeoutException

Cause: The selector is wrong, the state never occurs, or the page is blocked or slower than the deadline. Fix: Inspect the live DOM, verify the selector in browser developer tools, wait for a more precise state, increase the timeout based on observed behavior, and preserve a diagnostic capture.

The element is present but the screenshot is blank

Cause: Presence only proves a DOM node exists; CSS, canvas drawing, or data fetching may still be incomplete. Fix: Wait for visibility plus a page-specific signal such as non-empty text, rows, or a completed status.

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

The screenshot shows a spinner or old data

Cause: Capture occurs before the asynchronous update finishes. Fix: Wait for the spinner to become invisible, for the status text to change, or for the old value to disappear and the new value to appear.

Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video

Different runs have different layouts

Cause: Window size, device scale, locale, timezone, or responsive breakpoints differ. Fix: standardize the browser window and relevant environment settings before get(), and use a fixed test account or fixture data.

PhantomJS will not start

Cause: The archived binary is incompatible with the host or the installed Selenium binding. Fix: reproduce the old pinned environment, or migrate to headless Chrome/Firefox rather than repeatedly changing modern dependencies around an unsupported browser.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with the response identifying the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

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.

One request is enough:

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 options such as full-page capture, element selectors, waits, custom JavaScript/CSS, device presets, PDFs, caching, signed links, webhooks, and bulk jobs. Every feature is included on every plan. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

FAQ

What is the best wait for a JavaScript page?

Wait for the specific visible element or application state that proves the screenshot is ready. There is no universal delay that fits every page.

Does readyState="complete" mean the screenshot is ready?

No. It marks navigation completion under the selected page-load strategy; JavaScript can continue rendering afterward.

Can I use time.sleep() at all?

Yes, for a known animation or transition after a meaningful readiness condition. It should not replace a condition-based wait for network-driven content.

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

Is PhantomJS supported by current Selenium Python?

The available documentation does not establish a current compatibility combination. PhantomJS itself is archived, so treat it as a pinned legacy dependency and choose a maintained browser for new projects.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.90
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.99

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.