How to Set Up Proxies in Selenium (Python)
Route Selenium (Python) traffic through an authenticated proxy in a few lines. Copy the code below and swap in your credentials.
Quick answer
Configure the proxy with a server URL plus separate username and password, then run your Selenium (Python) script through it. Full code below.
Selenium (Python) proxy example
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("--proxy-server=http://host:port")
driver = webdriver.Chrome(options=options)
driver.get("https://httpbin.org/ip")
print(driver.page_source)Chrome's --proxy-server flag does not accept inline user:pass credentials, so for authenticated proxies you either whitelist your IP with the provider or load a small background extension that answers the auth prompt. IP authentication is the cleanest path for headless Selenium; credential extensions are the fallback when your egress IP is dynamic. Rotation is typically handled by pointing every session at a rotating gateway rather than swapping the flag per request.
Rotating proxies
For browser automation, give each Selenium (Python) browser context its own sticky-session endpoint so every sub-request in a page load shares one IP — per-request rotation would break the session.
Best proxies to use with Selenium (Python)
Cheapest-Proxies.com EDITOR'S CHOICE
4.9Best overall value across every proxy type and use case · flexible pay-as-you-go plans
Visit Cheapest-Proxies.comBright Data
4.6Enterprise-grade proxy and web data platform · from ~$8-9/GB (residential, volume-dependent)
Read Bright Data reviewOxylabs
4.6Premium enterprise proxies and scraper APIs · from ~$8/GB (residential, volume-dependent)
Read Oxylabs reviewSmartproxy
4.5User-friendly proxies with excellent price-to-performance · from ~$3.50-7/GB (residential)
Read Smartproxy reviewOur #1 pick is a sponsored partner. Remaining providers are ranked editorially by rating and value.
Frequently Asked Questions
How do I add a proxy in Selenium (Python)?
Pass a server URL plus username and password to Selenium (Python)’s proxy option, as shown in the code above.
What proxies work best with Selenium (Python)?
Residential or rotating proxies from a reliable provider give the best success rate for Python projects.
Can Selenium (Python) rotate proxies automatically?
Use one sticky session per browser context; rotate by launching a new context with a fresh endpoint rather than per request.
Does Selenium (Python) support authenticated proxies?
Yes. Provide the username and password (as a URL or separate fields) and Selenium (Python) handles the auth handshake.
Related Guides
Best proxies for Selenium (Python)
We compared 40+ providers on price, coverage, and reliability — this one offered the best overall value.
Visit Cheapest-Proxies.com