How to Set Up Proxies in SeleniumBase
Route SeleniumBase 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 SeleniumBase script through it. Full code below.
SeleniumBase proxy example
from seleniumbase import SB
with SB(uc=True, proxy="user:pass@host:port") as sb:
sb.open("https://httpbin.org/ip")
print(sb.get_page_source())SeleniumBase accepts a single proxy string (including user:pass@host:port) and transparently builds the auth extension for you, solving the credential problem that plain Selenium has. Combined with its undetected-chromedriver mode (uc=True) it is a popular pick for scraping sites with bot detection behind residential proxies. Pass a rotating gateway as the proxy value and each fresh SB session picks up a new exit IP.
Rotating proxies
For browser automation, give each SeleniumBase 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 SeleniumBase
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
Does SeleniumBase support authenticated proxies?
Yes. Provide the username and password (as a URL or separate fields) and SeleniumBase handles the auth handshake.
Can SeleniumBase rotate proxies automatically?
Use one sticky session per browser context; rotate by launching a new context with a fresh endpoint rather than per request.
What proxies work best with SeleniumBase?
Residential or rotating proxies from a reliable provider give the best success rate for Python projects.
How do I add a proxy in SeleniumBase?
Pass a server URL plus username and password to SeleniumBase’s proxy option, as shown in the code above.
Related Guides
Best proxies for SeleniumBase
Across the providers we compare, this network stood out for value and consistent performance.
Visit Cheapest-Proxies.com