How to Use Proxies with Selenium in 2026

By Marcus Reiner · 2026-06-03 · 10 min read · Engineering

seleniumheadless

Selenium's proxy story is messier than Playwright's. Here's what actually works for auth-required residential proxies.

The auth problem

Selenium's `--proxy-server` Chrome arg supports IP:port but not username:password. For auth'd residential proxies (every major provider), you need a workaround.

Option 1 — selenium-wire (cleanest)

```python from seleniumwire import webdriver opts = {'proxy': {'https': 'http://user:pass@gate.decodo.com:7000', 'http': 'http://user:pass@gate.decodo.com:7000'}} driver = webdriver.Chrome(seleniumwire_options=opts) ``` selenium-wire intercepts at the network layer. Works with auth, supports SOCKS5, lets you inspect requests.

Option 2 — Chrome extension trick

Build a tiny Chrome extension that responds to onAuthRequired with your credentials, load it via --load-extension. Hacky but stable, no extra deps.

Option 3 — Proxy-Auth via undetected-chromedriver

undetected-chromedriver supports the extension trick natively. Bonus: it patches the WebDriver detection vectors Cloudflare/DataDome check.

Should you still use Selenium?

For new projects, Playwright is faster, has a cleaner API, native auth proxy support, and a better stealth ecosystem. Selenium is the right choice only if you're locked into an existing Selenium grid.

FAQ

Does undetected-chromedriver beat all anti-bot?

It beats the easy 80%. For DataDome/Kasada/Akamai, pair it with a managed Web Unlocker for the hardest pages.

Back to Blog