Skip to content
Selenium

Using our proxies with Selenium

Selenium configures proxies through the standard WebDriver proxy capability. Because Chrome ignores credentials embedded in proxy settings, we usually set up Selenium access by IP allowlist.

Pick a proxy

Compatibility

  • The W3C WebDriver proxy capability has proxyType, httpProxy, sslProxy, socksProxy, socksVersion, noProxy and proxyAutoconfigUrl.
  • Selenium bindings expose it as a Proxy object on browser options (Python: options.proxy = Proxy({...}) with ProxyType.MANUAL).
  • The capability has no separate username/password keys, and Chrome does not use credentials embedded in proxy settings.
  • Chrome supports HTTP, HTTPS, SOCKSv4 and SOCKSv5 proxies, but no authentication for SOCKSv5.
Protocols:
HTTP, HTTPS (CONNECT), SOCKS5
Connection:
IP allowlist

Configuration

# check_ip.py — Chrome ignores credentials embedded in proxy settings,
# so this setup uses an IP allowlist (send us your outbound IP).
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.proxy import Proxy, ProxyType

options = webdriver.ChromeOptions()
options.proxy = Proxy({
    "proxyType": ProxyType.MANUAL,
    "httpProxy": "PROXY_HOST:PORT",
    "sslProxy": "PROXY_HOST:PORT",
})

driver = webdriver.Chrome(options=options)
driver.get("https://api.ipify.org?format=json")
print(driver.find_element(By.TAG_NAME, "body").text)
driver.quit()

httpProxy and sslProxy point to the same host:port, so both HTTP and HTTPS pages go through the proxy. Access works by IP allowlist: send us the outbound IP of the machine or grid node that runs the browser.

PROXY_HOST, PORT, USERNAME and PASSWORD are placeholders. After we select proxies for your task, we send you the real host, port and credentials.

Check the result

python check_ip.py
# expected output: {"ip":"<exit IP>"}
  1. Run the script and confirm the body text shows the exit IP we sent you.
  2. Look up the exit IP in two independent GeoIP services and confirm both show the country (and city, if you asked for one) from your request. GeoIP databases can disagree; tell us if they do.
  3. Open a page of your own site in the same session and verify language, currency and redirects for the requested country.

What to put in the request

  • Browser and where it runs (local, CI runner, Selenium Grid node) and the outbound IP of that machine for the allowlist.
  • Protocol: HTTP or SOCKS5.
  • Countries and session mode (static IP is usual for repeatable test runs).
  • The sites under test and confirmation that you own them or may test them.

Common pitfalls

  • Adding user:password to httpProxy for Chrome: it is ignored, and the browser shows a proxy authentication error.
  • Allowlisting your laptop's IP while tests run on a CI runner or remote grid node with a different outbound IP.
  • Setting httpProxy only: HTTPS pages then bypass the proxy unless sslProxy is set as well.

Recommended proxy types

Sources

Not sure which proxy fits?

Describe the task in two sentences. We reply with a concrete setup and price, usually within one business day.

Availability, exact parameters and price are confirmed in our reply after manual selection. Nothing is charged automatically.

Pick a proxy