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.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
WatchGuard Firebox M295 High Availability Unit with 3 Year Standard Support - HA Device for... | $2,185.11 | Buy on Amazon |
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()
- Install Selenium in the Python environment where you will run the script:
python -m pip install selenium. - Set
httpProxyandsslProxyto the proxy endpoint’s host and port as required by that endpoint. The example uses a placeholder host, not a working public proxy. - Run the script. Selenium opens the URL through the configured browser session and writes
screenshot.pngto the current working directory. - 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.
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
- 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.
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.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.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Quick 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.




