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.

First decide what “save an image” means. To save what Firefox renders, use Selenium’s screenshot methods: the viewport, a full document, or one element. To save the original image file and its response bytes, trigger a download and configure Firefox’s download preferences before starting the driver. These are different tasks: a screenshot is not the original JPEG, PNG, or WebP file.

Choose between a screenshot and the original image file

A browser screenshot captures rendered pixels. It is the right choice when you need the visible result, including the page’s layout and the image as Firefox displays it. Selenium’s Firefox WebDriver supports screenshots of the viewport, the full document, and an individual element.

A download saves the file returned by the website, rather than rasterizing its appearance. Use this when you need the original image bytes or file format. A page may display a responsive or transformed version of an image, so the displayed image and the original resource are not necessarily identical.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Need Use What you get
Visible browser window driver.save_screenshot(path) Viewport screenshot as PNG
Whole page beyond the viewport driver.save_full_page_screenshot(path) Full-document PNG
One rendered image or other element element.screenshot(path) PNG of that element
Original JPEG, PNG, WebP, or other downloaded resource Firefox download preferences plus a download action Original server response file, subject to what the site provides

Save a screenshot with Selenium and Firefox

The examples use Selenium’s Python API. Install Selenium in the Python environment used to run the script, ensure Firefox is installed, and use a Selenium-compatible Firefox driver setup. Create the output folder before saving; relative paths are relative to the process’s working directory.

#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

Capture the visible viewport

from pathlib import Path
from selenium import webdriver

out = Path("artifacts")
out.mkdir(parents=True, exist_ok=True)

driver = webdriver.Firefox()
try:
    driver.get("https://example.com")
    ok = driver.save_screenshot(str(out / "page.png"))
    if not ok:
        raise OSError("Firefox could not write the screenshot")
finally:
    driver.quit()

save_screenshot writes the current visible viewport to a PNG file and returns a success value. Check that value rather than assuming the file was written. Use a full path if your script may be launched from different working directories.

Capture the full document

from pathlib import Path
from selenium import webdriver

out = Path("artifacts").resolve()
out.mkdir(parents=True, exist_ok=True)

 driver = webdriver.Firefox()
try:
    driver.get("https://example.com")
    path = out / "full-page.png"
    ok = driver.save_full_page_screenshot(str(path))
    if not ok:
        raise OSError(f"Firefox could not write {path}")
finally:
    driver.quit()

Use the full-document method when content continues below the current viewport. The Firefox WebDriver API describes this as saving a full-document screenshot to a PNG image file. Use a .png filename and a full path, as required by that API documentation. This captures a longer rendered page; it does not download the image files embedded in the page.

Code note: Remove the leading space before driver in the line shown above if copying the snippet; the executable version should be:

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.
driver = webdriver.Firefox()

Save one rendered image element

from selenium.webdriver.common.by import By

image = driver.find_element(By.CSS_SELECTOR, "img.hero")
ok = image.screenshot("artifacts/hero.png")
if not ok:
    raise OSError("Firefox could not write the element screenshot")

Replace img.hero with a CSS selector matching the element you want. The element screenshot method writes a PNG and returns a boolean. It is useful when a full-page or viewport capture would include overlays, surrounding layout, or unrelated content. Locate the element only after navigating to the page and when it is present in the DOM.

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

Download the original image instead of taking a screenshot

For an original file, configure Firefox to save downloads to a known folder and to save the server’s image MIME type without prompting. Set these preferences before constructing webdriver.Firefox(). The preferences cover the destination and the file-type prompt behavior; they do not themselves initiate a download. Your script must still navigate to the page and click the download link or otherwise trigger the site’s download action.

from pathlib import Path
from selenium import webdriver
from selenium.webdriver.firefox.options import Options

out = Path("downloads").resolve()
out.mkdir(parents=True, exist_ok=True)

options = Options()
options.set_preference("browser.download.folderList", 2)
options.set_preference("browser.download.dir", str(out))
options.set_preference("browser.download.useDownloadDir", True)
options.set_preference(
    "browser.helperApps.neverAsk.saveToDisk",
    "image/jpeg,image/png,image/webp,application/octet-stream",
)
options.set_preference("pdfjs.disabled", True)

driver = webdriver.Firefox(options=options)
try:
    driver.get("https://example.com")
    # Find and click the page's download link here.
    # Wait for the completed file in `out` before using it.
finally:
    driver.quit()

The MIME types in the example are a practical list, not a guarantee that every site will return one of them. When possible, determine the response’s actual Content-Type and include it in browser.helperApps.neverAsk.saveToDisk. Do not assume an image served as WebP is image/jpeg. If a download still prompts or fails to save, confirm both the actual MIME type and the Firefox version’s handling of these preferences.

The pdfjs.disabled preference is included in Selenium’s documented download-preference pattern; it is relevant when Firefox’s PDF handling would otherwise intercept a PDF download, not an image-format setting. Firefox’s download settings separately address the destination folder and actions by file type. These preference names and their behavior can be version-sensitive, so verify them against the Firefox version used in your environment, especially in CI.

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

Wait until the download is complete

A click returning does not prove that a file has finished downloading. Before another part of your program opens or moves the file, wait for the expected file to appear and for Firefox’s temporary download file to disappear. The temporary extension and exact timing depend on the download and Firefox version. Do not consume a partial file just because a matching filename exists.

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.
import time
from pathlib import Path

out = Path("downloads").resolve()
expected = out / "photo.webp"
deadline = time.time() + 60

while time.time() < deadline:
    partial_files = list(out.glob("*.part"))
    if expected.exists() and not partial_files:
        break
    time.sleep(0.25)
else:
    raise TimeoutError("Download did not complete in time")

Adapt the expected filename and temporary-file check to the site’s actual download behavior. Some sites choose the filename dynamically. If the site returns an unexpected name, inspect the directory and identify the completed file rather than assuming the link text is its filename.

Handle authenticated image downloads

If the image link requires a logged-in session, clicking it in the same Firefox session may use the browser’s authentication state. Another approach is to obtain the image URL and request it with an HTTP client that has the required cookies. That is an application-level download strategy, not a Selenium screenshot feature. The URL alone may not be sufficient: authorization headers, cookies, or other access rules may be required. Respect the site’s access controls and terms.

Firefox’s generic downloadable-file methods are not a portable shortcut for this workflow. The current Firefox WebDriver reference documents get_downloadable_files as implemented only in RemoteWebDriver; do not assume that method is available in Firefox. For a local Firefox run, configure the download folder and MIME behavior, trigger the download, then verify the resulting file.

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

Wait for the right page state before capturing

A screenshot taken immediately after navigation can catch an incomplete page or an image that has not loaded. Wait for a meaningful condition before capture, such as the target image being present and complete. For a page with lazy-loaded images, scroll the relevant image into view before taking the screenshot if the site loads it only when it approaches the viewport. These waits are about the site’s rendering state; they do not change whether the output is a screenshot or an original download.

Rank #4
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.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait

image = WebDriverWait(driver, 20).until(
    lambda d: d.find_element(By.CSS_SELECTOR, "img.hero")
)
WebDriverWait(driver, 20).until(
    lambda d: d.execute_script(
        "return arguments[0].complete && arguments[0].naturalWidth > 0",
        image,
    )
)
image.screenshot("artifacts/hero.png")

This checks that the image element has completed loading and has a nonzero natural width before capturing it. Adapt the selector and wait condition to the page. A page can still update after that check, so wait for any application-specific state that matters to your capture.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a rendered website screenshot rather than a local Firefox session, ScreenshotNeo offers a one-request screenshot API. It can return PNG, JPEG, WebP, or PDF. For example, this cURL request saves a WebP capture of Stripe:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Python version:

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.
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js version:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture; each of those cleanup steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools 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. Those captures are rendered screenshots, not a substitute for downloading an original image file from an authenticated or direct image URL.

Try ScreenshotNeo when an API capture fits the job. Sign up for 1,000 free screenshots a month, with no card required.

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.

Troubleshoot common Firefox image-saving problems

  • You got a screenshot, not the original file. Use a Firefox download action for original response bytes. save_screenshot, save_full_page_screenshot, and element.screenshot capture rendered pixels.
  • A save dialog appears. Set preferences before constructing the Firefox driver and make sure browser.helperApps.neverAsk.saveToDisk includes the server’s actual MIME type.
  • The expected file is missing. Create the destination folder first, use an absolute download path, confirm that the click triggered a download, and wait for completion rather than checking immediately.
  • The file exists but is incomplete. Check for a temporary download extension and wait until the transfer is done before reading or renaming the file.
  • The screenshot is blank or the image is absent. Wait for the target page state and image load; for a specific image, capture the element after confirming it has loaded.
  • The capture cuts off the rest of the page. Use save_full_page_screenshot rather than the viewport method, and save to a full path ending in .png.
  • It works on one machine but not in CI or headless mode. Keep the download preferences in place before driver startup in both modes, and record the Firefox and Selenium versions in CI logs. Preference handling may vary by Firefox version.
  • A generic download-inspection method is unavailable. Firefox’s current WebDriver reference limits get_downloadable_files to RemoteWebDriver. Use the configured download-folder workflow instead of assuming that method is supported by Firefox.

Practical reliability and cost considerations

For screenshots, the main reliability choices are output scope, readiness, and destination: select viewport, full document, or element; wait for the state you intend to capture; and use a writable directory. For original downloads, also verify that the file type matches the server’s response and that the transfer completed. A screenshot image is newly rendered output, while a download preserves the server-provided file; choose based on whether you need appearance or original bytes.

Firefox downloads involve browser preferences and browser-version behavior, so a run that succeeds locally should be checked against the Firefox version and mode used in automation. Selenium’s Firefox screenshot APIs are the simpler route when the desired deliverable is a rendered PNG. A screenshot API such as ScreenshotNeo is a separate option when the task is to capture a URL through a service rather than control a local browser; its free and paid plan allowances are listed in the section above.

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

Frequently Asked Questions

Can Selenium save an image element as JPEG instead of PNG?

The Firefox element screenshot API described here writes PNG. To preserve an image in its original format, download the resource rather than using an element screenshot.

Does taking a full-page screenshot download every image on the page?

No. It captures the full rendered document as a PNG; it does not save each embedded image as its original file.

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.