Selenium grids and CI runners send every browser session from the machine's own IP. Run enough sessions and a site rate-limits that one address with HTTP 429 Too Many Requests, and geo-dependent tests only ever see the country the runner sits in.
Selenium sets a proxy through browser options, but Chrome takes only host and port from them: it won't use credentials embedded in proxy settings and supports no authentication method for SOCKS5. A proxy with a password therefore needs something to answer its 407 challenge.
Selenium has that built in. With WebDriver BiDi enabled, driver.network.add_auth_handler(username, password) answers authentication challenges — the proxy's included, in our test. One catch we hit with ChromeDriver 153: a classic driver.get() stalled while the proxy was asking for the password, while navigating with browsing_context.navigate worked, and later driver.get() calls reused the credentials. A second catch: Selenium also hands a proxy set through options.proxy to Selenium Manager, which then tries to download ChromeDriver through it without the password — so the code passes the proxy as a Chrome flag instead.
Scroll horizontally with the arrow keys to read all content.
Recommended Selenium setup
Criterion
Choose
Why
Product
Static datacenter proxy
Fastest and cheapest per IP, fixed for the whole term — fits regression runs, grids and CI
If the site blocks servers
Rotating residential, Budget line
Real household IPs from US$1.50/GB, billed per GB
How many IPs
One per parallel session or grid node
Sessions stop sharing one address and one rate limit
Country
The market your test covers: US, CA, GB, DE, NL, JP, KR or SG for datacenter
Location-dependent pages render per country
Protocol
HTTP
Chrome can't authenticate to SOCKS5
Where to set it
A --proxy-server flag in ChromeOptions
options.proxy would also send Selenium Manager's ChromeDriver download through the proxy, without the password
Authentication
Selenium's BiDi auth handler
Built into Selenium 4; nothing extra to install or keep compatible
The button below opens Static Datacenter Proxies with the AI and automation use case. Choose Region, Term, Protocol and Quantity (up to 100 IPs at a time) before you pay.
The button below opens Static Datacenter Proxies (Per IP and term) with the AI and automation use case. Under Connection settings pick the Region, choose a Term and set Protocol to HTTP. Set Quantity to the number of IPs you need (one for each parallel session, up to 100 at a time). Then click Review cost and generate.
Copy each IP
In My assets, Copy gives host:port:user:password. Put host and port in PROXY_HOST and PROXY_PORT, user and password in PROXY_USER and PROXY_PASS.
Set the proxy and the auth handler
In ChromeOptions set enable_bidi = True and add the argument --proxy-server=http://host:port, with no user or password in it. After the driver starts, call driver.network.add_auth_handler(user, password).
Open the first page over BiDi
Use driver.browsing_context.navigate(context=driver.current_window_handle, url=..., wait="complete") for the first page. After that, ordinary driver.get() works.
Expected result api.ipify.org shows the proxy's IP, not your machine's.
Run it on a grid or CI
The browser connects to the proxy from the machine that runs it, so that node or runner needs outbound access to the proxy's port. Give each parallel session its own IP.
Selenium proxy with username and password (Python)
Scroll horizontally with the arrow keys to read all content.
# pip install -U selenium (Selenium Manager fetches a matching ChromeDriver)
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
# From Proxy302 → My assets → Copy (host:port:user:password); use the HTTP endpoint
endpoint = f"{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}"
options = webdriver.ChromeOptions()
options.enable_bidi = True # the auth handler below runs over WebDriver BiDi
# A Chrome flag, not options.proxy: Selenium Manager would fetch ChromeDriver through options.proxy, without the password
options.add_argument(f"--proxy-server=http://{endpoint}")
driver = webdriver.Chrome(options=options)
try:
# Chrome ignores user:pass written into proxy settings, so answer the 407 challenge instead
driver.network.add_auth_handler(os.environ["PROXY_USER"], os.environ["PROXY_PASS"])
# Navigate over BiDi: a classic driver.get() can stall while the proxy challenge is pending
driver.browsing_context.navigate(
context=driver.current_window_handle,
url="https://api.ipify.org?format=json",
wait="complete",
)
print(driver.find_element(By.TAG_NAME, "body").text) # the proxy's exit IP
finally:
driver.quit()
Checked on 2026-10-18 with Selenium 4.41.0 and 4.51.0 and Chromium/ChromeDriver 153 through a local password-protected proxy, for an HTTP and an HTTPS page: the right password loaded the page, a wrong one loaded nothing, and on a first run Selenium Manager downloaded ChromeDriver without going through the proxy.
driver.get() hangs, then 'Timed out receiving message from renderer'
Check Is the first navigation a classic driver.get() while the proxy is asking for a password?
Fix Register add_auth_handler first and open the first page with browsing_context.navigate(..., wait="complete"); later driver.get() calls reuse the credentials.
407, or the proxy is ignored
Check Is enable_bidi set before the driver starts? Did you put user:pass@ into --proxy-server?
Fix Set options.enable_bidi = True, give --proxy-server only http://host:port, and pass the user and password to add_auth_handler.
'WebDriver' object has no attribute 'network'
Check Which Selenium version is installed?
Fix Upgrade with pip install -U selenium; we checked 4.41.0 and 4.51.0.
'Unable to obtain driver for chrome' on the first run
Check Is the proxy set through options.proxy? Selenium Manager then tries to download ChromeDriver through it, without the password.
Fix Pass the proxy as a --proxy-server flag, as in the code above, or point Service('path/to/chromedriver') at a ChromeDriver you already have.
Selenium proxy FAQ
How do I use a proxy with username and password in Selenium?
Pass the proxy's host:port to Chrome with a --proxy-server flag in ChromeOptions, enable BiDi, call driver.network.add_auth_handler(user, password) and open the first page with browsing_context.navigate. The code above does exactly that.
No. The auth handler is part of Selenium itself, so there's no extra package or extension to install and keep compatible.
Does it work on Selenium Grid?
The proxy is applied by the browser on the node, so the node needs outbound access to it. We ran the auth handler against a local ChromeDriver, not a Grid — test one session on your Grid first.
Why a --proxy-server flag instead of options.proxy?
Selenium passes options.proxy to Selenium Manager as well, and Selenium Manager downloads ChromeDriver through it — without the password, so a first run fails with a 407. Setting SE_PROXY doesn't help, because the proxy from your options takes precedence. A --proxy-server flag reaches only Chrome, so the driver download goes direct.
Playwright proxy setup with username and password: static datacenter IPs for tests and CI, rotating residential from US$1.50/GB when a site blocks servers.
Fast datacenter proxies with fixed IPs, low latency and high concurrency — the lowest cost per IP for APIs, testing and bulk jobs. Pick the country; pay per IP and term.
Rotating residential per-GB prices as published on the pricing page and used by the console (Budget US$1.50/GB, US$1.35/GB in the 100 GB package; Premium US$5.00/GB; 1 PTC = US$1). Static ISP and datacenter IPs are quoted live per IP and term.
Option names, billing modes and limits as shown in the live console on 2026-10-18: Line (Premium/Budget), Exit mode, Region, State, City, Protocol (HTTP/SOCKS5), Quantity (1–500), Term, Auto-renew IP (not yet available), My assets → Copy / Rotate / Renew / Copy for AI. Rotating residential connects through proxy.proxy302.com:2222 (HTTP) and :3333 (SOCKS5). Static datacenter IPs were sold in 8 countries on 2026-10-18 (read-only check of the production catalogue): US, CA, GB, DE, NL, JP, KR, SG.
Local proxy fixture run
Local example · Checked:
The code block was executed on 2026-10-18 against a local password-protected proxy that answers 407 without valid credentials, for an HTTP page and for an HTTPS page reached through a CONNECT tunnel; Selenium 4.41.0 and 4.51.0 with Chromium and ChromeDriver 153.0.8010.12. With the auth handler and a BiDi navigation the page loaded through the proxy; a wrong password loaded nothing. A classic driver.get() issued while the proxy challenge was pending stalled until the page-load timeout; after the first BiDi navigation had authenticated, later driver.get() calls worked. With an empty Selenium Manager cache, this version downloaded ChromeDriver directly and ran; the same script with options.proxy failed, because Selenium Manager sent its download through the proxy without the password.
A local check proves the configuration syntax and authentication path, not access to any specific website, country or platform.
Ready to connect?
Create an account, top up once and pick rotating residential, static ISP or datacenter. Rotating residential exits cover 195+ countries and regions.