← Back to Blog

Proxies in SeleniumBase: Login Credentials, UC Mode, and Common Errors

In SeleniumBase, a password-protected proxy is connected in one line proxy="USER:PASS@HOST:PORT" in SB() or Driver(). We will discuss formats, UC Mode and CDP Mode, multithreading with multi_proxy, proxy type selection, and common errors: SOCKS5 with password, Firefox, headless.

📅November 22, 2026
Proxies in SeleniumBase: Login Credentials, UC Mode, and Common Errors

In SeleniumBase, a proxy is connected with a single parameter: proxy="USER:PASS@HOST:PORT" in SB() or Driver(), or with the flag --proxy in pytest. The framework automatically handles the login and password, so there is no need to enter them in the Chrome popup. If the proxy "does not work," the usual reasons are one of three: SOCKS5 with a password (which Chrome does not support), authorization in Firefox (which is only available for Chromium), or multiple threads with different accounts without the multi_proxy flag. Below, we discuss working options for normal mode, UC Mode, and CDP Mode, as well as a list of common errors.

What is SeleniumBase and why is using a proxy easier than in plain Selenium

SeleniumBase is a framework for browser automation and testing in Python built on top of Selenium. It is often chosen for parsing due to UC Mode (undetected mode that masks automation) and CDP Mode (browser control via the Chrome DevTools protocol). The project is actively developed: version 4.58.3 was released on November 21, 2026, followed by versions 4.58.0, 4.58.1, and 4.58.2 within a week. The release notes for these versions do not mention any changes regarding proxies, so everything described below is relevant for the current version.

In plain Selenium, using a proxy with a login and password is a well-known pain point: the --proxy-server flag in Chrome does not accept user:pass, requiring the creation of an extension or setting up an intermediate proxy. SeleniumBase handles this: the authorized format is accepted directly in the parameter.

What proxy formats does SeleniumBase understand

According to the official documentation (section Customizing test runs), the following options are supported:

Requirementpytest FlagSB() / Driver() Parameter
Proxy without a password--proxy=SERVER:PORTproxy="SERVER:PORT"
Proxy with login and password (Chromium only)--proxy=USERNAME:PASSWORD@SERVER:PORTproxy="USER:PASS@SERVER:PORT"
SOCKS4 / SOCKS5 without a password--proxy="socks5://IP:PORT"proxy="socks5://IP:PORT"
Proxy exceptions--proxy-bypass-list="*.foo.com"proxy_bypass_list="..."
PAC file--proxy-pac-url=URLproxy_pac_url="URL"
Different proxies with passwords in threads--multi-proxymulti_proxy=True

There are also two useful flags: --proxy-driver downloads the browser driver through the same proxy (useful if the server cannot reach the driver storage directly), and --no-tt removes the Chrome service flag --test-type in proxy mode — this is described in the documentation as an additional layer of stealth.

What a proxy solves and what it does not

A proxy changes the IP address from which the browser accesses the site: the country, city, network type, and address reputation. This helps bypass IP blocks, request limits from a single address, and regional content restrictions.

A proxy does not fix browser fingerprinting, script behavior, or cookies. If a site detects automation based on browser characteristics, UC Mode will help, not just changing the IP. Conversely, a perfectly masked browser on a data center IP that has already been flagged by anti-bot systems will still receive a CAPTCHA. On secure sites, both layers work together.

Step-by-step setup

  1. Install or update the framework: pip install -U seleniumbase.
  2. Obtain proxy details from your account: host, port, username, and password. Use the HTTP protocol — it works with login and password authorization in Chromium without workarounds.
  3. Connect the proxy in the code. Normal mode:
    from seleniumbase import SB
    
    with SB(proxy="USER:PASS@HOST:PORT") as sb:
        sb.open("https://api.ipify.org/")
        print(sb.get_text("body"))
  4. For secure sites, enable UC Mode — the same parameter, plus uc=True:
    with SB(uc=True, proxy="USER:PASS@HOST:PORT") as sb:
        sb.uc_open_with_reconnect("https://example.com/", 4)
    Through Driver(), it remains the same: Driver(uc=True, proxy="USER:PASS@HOST:PORT").
  5. For CDP Mode in its "pure" form, use sb_cdp.Chrome(proxy="user:pass@host:port") — this parameter is included in its list of options. However, if you switch to CDP Mode from UC Mode using sb.activate_cdp_mode(), the documentation does not specify whether the proxy remains after the switch — check the IP after activation.
  6. For tests on pytest, pass the flag in the command line: pytest my_test.py --proxy=USER:PASS@HOST:PORT --uc.
  7. Check that the traffic is going through the proxy: open a service that shows the IP and compare it with the address of the server where the script is running. It is advisable to check in each mode you are using.
  8. For multithreading (for example, pytest -n 4) with different accounts, add --multi-proxy or multi_proxy=True — the flag is explicitly described as allowing multiple proxies with authorization in multithreaded mode.

Common addresses can be stored in a dictionary PROXY_LIST in the file seleniumbase/config/proxy_list.py and called by key: --proxy=proxy1. Note that this file is located within the installed package and may be overwritten when updating SeleniumBase, and the username and password are stored in plain text. It is more reliable to keep the proxy string in an environment variable and read it through os.environ.

What type of proxy is suitable

TaskType of ProxyWhy
Sites behind Cloudflare, DataDome, AkamaiResidentialIP addresses from home providers are trusted more by anti-bots
Mobile versions of sites, social networks, the strictest anti-botsMobileAddresses of telecom operators, many real people behind one IP
Testing your site from different countries, open directories, unprotected APIsData centerCheap and fast, but banned first on secure sites

For browser parsing with UC Mode, a logical choice is residential proxies: at ProxyCove, they cost $2.70 per GB, and with targeting by city or provider — $4.70. For tests and open sources, data center proxies at $1.50 per GB will suffice. IP rotation — a new address for each request or fixed for an interval of 1 to 120 minutes — can be configured in the account; for sessions with login on the site, use a fixed IP, otherwise the site will see the address change mid-session.

Remember that the browser downloads the entire page: images, fonts, scripts. The traffic for one page is significantly larger than that of an HTTP library. The parameter block_images=True (or the flag --block-images) disables image loading and significantly saves gigabytes.

Restrictions are straightforward: the proxy works for HTTP and HTTPS — that is, for everything the browser does. Protocols over UDP (voice calls, gaming traffic) do not go through such proxies, but this is not needed for SeleniumBase.

Common errors

SOCKS5 with login and password

In the SeleniumBase documentation, examples of SOCKS4 and SOCKS5 are provided only without credentials. This is not accidental: Chrome itself does not support SOCKS5 with authorization and throws an error like ERR_NO_SUPPORTED_PROXIES — a breakdown is available in the article why SOCKS5 with a password does not work in Chrome. The solution is to use HTTP access to the same proxy.

Firefox and proxy with password

Regular proxies work in both Chromium and Firefox, but the documentation promises login and password authorization only for Chromium. If you are running tests with --firefox, use proxies without a password (with IP access, if provided by the provider) or switch to Chrome.

Special characters in the password

The string is parsed by the characters : and @. If they are present in the username or password, the format breaks. It is easiest to generate a password from letters and numbers.

Different accounts in threads without multi_proxy

When running in multiple threads with different proxies with passwords without --multi-proxy, authorization errors and address mixing may occur. The flag exists for this purpose.

UC Mode in headless

The UC Mode documentation warns: it can be detected in headless mode. On a Linux server, instead of headless, run the browser with xvfb=True (virtual display). For such servers, the documentation recommends using the SB manager instead of Driver: it has a special virtual display, and without changing settings, headed/headless Xvfb is enabled by default. A good IP does not save you if it reveals the launch mode itself.

Excess traffic through the proxy

If the script also opens internal services, your API, or sites that do not require a proxy, exclude them: proxy_bypass_list="localhost;*.internal.example". Hosts are listed with semicolons, and wildcard masks are supported. This way, you do not pay for gigabytes that could have been sent directly.

Rotation on each request during login

The browser loads dozens of resources on a page. If the IP changes with each request, one page comes from different addresses, and sites with session checks will kick the user out. For such scenarios, a fixed IP is needed for the duration of the session.

Conclusion

In SeleniumBase, a proxy with a password is connected with a single line — proxy="USER:PASS@HOST:PORT" — and works in normal mode, UC Mode, and through sb_cdp.Chrome. Use HTTP instead of SOCKS5 with a password, keep authorized proxies in Chromium, add multi_proxy for threads, and check the IP in each mode. For secure sites, the combination of "UC Mode plus residential IP" results in significantly fewer CAPTCHAs than any of these layers separately. You can find suitable proxies for your task at ProxyCove: payment is per gigabyte, with no subscription fees.