Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

How to Capture a Webpage Screenshot with Selenium Using a Proxy

Use Python Selenium browser options to route page traffic through a proxy, save a current-window PNG, and understand full-page and authentication limits.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the proxy on the browser options passed to Selenium, then navigate to the page and save a screenshot. In Python, driver.save_screenshot() captures the current browser window as a PNG; it does not automatically capture the whole document. Selenium Manager has a separate proxy setting for its own network access, which is not a substitute for routing the browser’s page traffic.

Capture a webpage through a proxy with Selenium

The example below uses Python and Chrome. Replace proxy.example:8080 with the host and port for a proxy you are authorized to use. It configures both HTTP and HTTPS proxy fields, a common pattern for an HTTP proxy serving web traffic; check your proxy endpoint’s protocol and your browser’s supported options before relying on those fields for another setup.

As an Amazon Associate I earn from qualifying purchases.

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType

options = webdriver.ChromeOptions()
options.proxy = Proxy({
    "proxyType": ProxyType.MANUAL,
    "httpProxy": "proxy.example:8080",
    "sslProxy": "proxy.example:8080",
})

driver = webdriver.Chrome(options=options)
try:
    driver.get("https://example.com")
    saved = driver.save_screenshot("screenshot.png")
    if not saved:
        raise OSError("Selenium could not save screenshot.png")
finally:
    driver.quit()
  1. Install Selenium in the Python environment where you will run the script: python -m pip install selenium.
  2. Set httpProxy and sslProxy to the proxy endpoint’s host and port as required by that endpoint. The example uses a placeholder host, not a working public proxy.
  3. Run the script. Selenium opens the URL through the configured browser session and writes screenshot.png to the current working directory.
  4. Check the return value from save_screenshot. It is a boolean; a false result means the file was not saved successfully.

Selenium’s Python WebDriver API describes save_screenshot(filename) as saving “a screenshot of the current window to a PNG image file.” The same API documents get_screenshot_as_file(filename) for a file and get_screenshot_as_png() and get_screenshot_as_base64() when you need image bytes or Base64 data instead. See the Selenium Python WebDriver API 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.

Choose between a window shot and a full-page shot

A standard WebDriver screenshot captures the current browser window, so content below the visible viewport may be absent. If a viewport image is what you need, scroll to the relevant part of the page before capturing it. If you need the whole document, use a full-page method documented for your browser rather than assuming the ordinary screenshot call will expand the page.

#1 Best Overall
WatchGuard Firebox M295 High Availability Unit with 3 Year Standard Support - HA Device for Failover, Requires Matching Primary - Not a Standalone Device - Rackmount Firewall (WGM295000+WGM2951603)
  • High Availability (HA) redundant unit for resilient failover and uptime. Operates only as the secondary in an HA pair and must be paired with a primary WatchGuard Firebox of the same model for synchronization and failover. Not a standalone appliance.
  • WatchGuard Firebox M295 High Availability Unit with 3 Year Standard Support License (WGM29501603) - The Firebox M295 combines enterprise-grade security with multi-gig connectivity, SD-WAN, TLS decryption, and proxy-based inspection in a compact rackmount design.
  • Standard Support covers software updates and round-the-clock emergency help. Add a Basic or Total Security Suite to activate IPS, gateway antivirus, and web filtering so threats are blocked before they reach users.
  • Standard Support provides reliable technical assistance and software updates for WatchGuard Firebox appliances. Offering 24x7 help for emergencies and business-hours support for routine needs, it ensures your network stays secure and operational.
  • Interfaces and continuity: 4x 2.5Gb RJ45, 4x 1Gb RJ45, 2x 10Gb SFP+ with VLANs and link aggregation, plus RIP, OSPF, BGP, and high availability to keep sites online.

Selenium’s Python Firefox driver API documents get_full_page_screenshot_as_file(filename) and save_full_page_screenshot(filename), as well as byte and Base64 variants. Those cited methods are Firefox-specific; do not assume they are available in Chrome or every other browser. Consult the API for the browser and Selenium version you use before implementing full-document capture: Firefox WebDriver API.

Put the proxy setting in the right place

For the browser’s page requests

Configure a manual proxy in the browser options, as in the example, when the page visit itself should use the proxy. Selenium’s driver-session documentation shows the proxy configured through browser options: Selenium WebDriver driver sessions.

For Selenium Manager’s network requests

Selenium Manager has its own HTTP proxy configuration for its network connections, such as work involved in managing a browser or driver. Its --proxy option, proxy configuration key and SE_PROXY environment variable do not configure the browser’s page-traffic proxy. See Selenium Manager documentation for its options and configuration forms.

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

When the proxy requires authentication

Proxy authentication is not uniform across browsers, protocols and endpoints. The cited Selenium examples establish the manual proxy-options pattern, but not a universal authenticated-proxy recipe. Do not assume that placing a username and password in a proxy URL works in every browser. Follow your proxy provider’s instructions for your browser and authentication method, and keep credentials in a secret store or environment configuration rather than source code, committed files or logs.

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

Troubleshoot proxy and screenshot failures

  • The driver will not start: First run the browser without a proxy. If that also fails, isolate browser and driver setup from proxy connectivity. Selenium Manager’s proxy setting can help with its own network access, but it does not route page visits.
  • The page will not load through the proxy: Confirm the endpoint’s host, port and protocol, then check its authentication requirements. Test with a page you are authorized to access. If appropriate, compare the apparent egress network using a trusted test endpoint; that is a diagnostic check, not a Selenium feature.
  • The page loads, but the screenshot file is missing: Save to a known writable path, such as an absolute path, and inspect the boolean returned by save_screenshot. A proxy connection problem and a file-write problem are separate issues.
  • The screenshot is missing content below the fold: The ordinary call captures the current window, not necessarily the full document. Use a browser-specific full-page API documented for your driver, such as the Firefox Python method, if a full-page image is required.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request can return an image or PDF without setting up a Selenium browser session. Its cleanup options accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers report the page verdict and billing status. AI agents can use its MCP server tools, including take_screenshot, get_page_info and capture_pdf.

For example, save a WebP screenshot of a page with cURL:

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

See the ScreenshotNeo API documentation for the request options. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.