# Selenium
Source: https://proxuno.com/docs/integration-selenium
Updated: 2026-07-15

Integrations

Three reliable ways to use authenticated proxies with Selenium WebDriver — IP whitelist, selenium-wire, and a local forwarding proxy — for Chrome and Firefox.

Updated 15 Jul 2026 2 min read API v1

### On this page

- [A. IP whitelist](#a-ip-whitelist)
- [B. selenium-wire (Python)](#b-selenium-wire-python)
- [C. Local forwarding proxy](#c-local-forwarding-proxy)
- [Rotation with Selenium](#rotation-with-selenium)
- [Troubleshooting](#troubleshooting)

Selenium passes proxy settings to the browser as `host:port` only. Chrome and Firefox then show a native login dialog for authenticated proxies, which WebDriver cannot fill. Pick one of three approaches:

| Approach | Credentials | Effort | Best for |
| --- | --- | --- | --- |
| A. IP whitelist | none in the browser | lowest | servers with a fixed public IP |
| B. selenium-wire | in Python code | low | Python projects, any number of proxies |
| C. Local forwarding proxy | in a sidecar process | medium | Java, C#, Selenium Grid, any language |

Rotating residential needs credentials (targeting lives in the username), so use B or C for residential.

## A. IP whitelist[#](#a-ip-whitelist)

Add your server's public IP in [Settings → Proxy access → IP whitelist](/dashboard/settings#access) (see [IP whitelist](/docs/ip-whitelist)), then pass `host:port`:

PythonCopy

```python
from selenium import webdriver

opts = webdriver.ChromeOptions()
opts.add_argument("--proxy-server=http://fr.mobile.gw.proxuno.com:10421")
driver = webdriver.Chrome(options=opts)
driver.get("https://api.ipify.org")
print(driver.find_element("tag name", "body").text)
driver.quit()
```

Firefox:

PythonCopy

```python
opts = webdriver.FirefoxOptions()
opts.set_preference("network.proxy.type", 1)
opts.set_preference("network.proxy.http", "fr.mobile.gw.proxuno.com")
opts.set_preference("network.proxy.http_port", 10421)
opts.set_preference("network.proxy.ssl", "fr.mobile.gw.proxuno.com")
opts.set_preference("network.proxy.ssl_port", 10421)
driver = webdriver.Firefox(options=opts)
```

## B. selenium-wire (Python)[#](#b-selenium-wire-python)

[selenium-wire](https://github.com/wkeeling/selenium-wire) runs a small proxy inside your Python process that adds the credentials upstream. The project is no longer actively maintained but remains widely used; pin its version.

cURLCopy

```bash
pip install selenium-wire "blinker<1.8"
```

PythonCopy

```python
from seleniumwire import webdriver

options = {
"proxy": {
"http": "http://m_k3v9q2xa:Hq7Lr2Nw8Zt4Bc6D@fr.mobile.gw.proxuno.com:10421",
"https": "http://m_k3v9q2xa:Hq7Lr2Nw8Zt4Bc6D@fr.mobile.gw.proxuno.com:10421",
"no_proxy": "localhost,127.0.0.1",
}
}
driver = webdriver.Chrome(seleniumwire_options=options)
driver.get("https://api.ipify.org")
```

selenium-wire intercepts TLS with its own certificate; Chrome accepts it automatically. Some sites detect the altered TLS fingerprint — if that matters, use approach C.

## C. Local forwarding proxy[#](#c-local-forwarding-proxy)

Run a tiny proxy on the same machine that forwards to Proxuno with credentials, and point the browser at it without credentials. [gost](https://github.com/go-gost/gost) does this in one command:

cURLCopy

```bash
gost -L http://127.0.0.1:3128 -F "http://m_k3v9q2xa:Hq7Lr2Nw8Zt4Bc6D@fr.mobile.gw.proxuno.com:10421"
```

Then, in any language:

JavaCopy

```java
ChromeOptions options = new ChromeOptions();
options.addArguments("--proxy-server=http://127.0.0.1:3128");
WebDriver driver = new ChromeDriver(options);
driver.get("https://api.ipify.org");
```

The TLS session stays end-to-end between the browser and the site (the forwarder only relays `CONNECT` tunnels), so fingerprints are unchanged. Run one forwarder per proxy on different local ports for parallel sessions.

## Rotation with Selenium[#](#rotation-with-selenium)

Rotate between tests, not in the middle of a page load. From Python:

PythonCopy

```python
import requests, time

def rotate(link: str) -> str:
r = requests.get(link, timeout=45)
if r.status_code == 429:
time.sleep(int(r.headers.get("Retry-After", 10)))
return rotate(link)
r.raise_for_status()
return r.json()["ip"]
```

Start a new WebDriver session (or clear cookies) after a rotation so the site does not tie the old session to the new IP.

## Troubleshooting[#](#troubleshooting)

| Symptom | Cause |
| --- | --- |
| A login pop-up appears and the test hangs | Credentials were not supplied — use one of the approaches above. |
| `ERR_PROXY_CONNECTION_FAILED` | Wrong host or port, or the forwarder (approach C) is not running. |
| Works locally, fails in CI | CI runners use a different egress IP than the whitelisted one. |

Something unclear, outdated or wrong on this page? Tell us — documentation issues are fixed in the next release at the latest.

[Report an issue with this page](/contact?topic=support&subject=Documentation%20issue%3A%20Selenium)
