Prompt

How do I use proxies with Selenium?

Technology / Data Infrastructure2 observationsLast seen Oct 10, 2026

Latest observation

Oct 10, 2026OpenAI APIWeb search: off

To use a proxy with Selenium, you typically configure the browser you’re automating to route traffic through the proxy before launching it.

Chrome

Python example

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

proxy = "http://127.0.0.1:8080"   # or http://user:pass@host:port for simple auth

options = Options()
options.add_argument(f'--proxy-server={proxy}')

driver = webdriver.Chrome(options=options)
driver.get("https://example.com")

Notes

  • For HTTP/HTTPS proxies, --proxy-server= is usually enough.
  • For SOCKS proxies:
    options.add_argument("--proxy-server=socks5://127.0.0.1:9050")
    
  • Chrome does not reliably support proxy auth via user:pass@host:port in all cases; authenticated proxies often need extra handling.

Firefox

Python example

from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile

profile = FirefoxProfile()
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.http", "127.0.0.1")
profile.set_preference("network.proxy.http_port", 8080)
profile.set_preference("network.proxy.ssl", "127.0.0.1")
profile.set_preference("network.proxy.ssl_port", 8080)
profile.update_preferences()

driver = webdriver.Firefox(firefox_profile=profile)
driver.get("https://example.com")

SOCKS example

profile = FirefoxProfile()
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.socks", "127.0.0.1")
profile.set_preference("network.proxy.socks_port", 9050)
profile.set_preference("network.proxy.socks_version", 5)
profile.update_preferences()

Using Selenium 4 / W3C proxy settings

You can also configure proxy settings via Proxy capabilities.

Python example

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType

proxy = Proxy()
proxy.proxy_type = ProxyType.MANUAL
proxy.http_proxy = "127.0.0.1:8080"
proxy.ssl_proxy = "127.0.0.1:8080"

capabilities = webdriver.DesiredCapabilities.CHROME.copy()
proxy.add_to_capabilities(capabilities)

driver = webdriver.Chrome(desired_capabilities=capabilities)

Authenticated proxies

If your proxy needs a username/password, common approaches are:

  1. Use browser-specific proxy auth extensions
  2. Use a local proxy helper that injects credentials
  3. Use tools like Selenium Wire (often easiest for intercepting and proxying requests)

Example with selenium-wire:

from seleniumwire import webdriver

options = {
    'proxy': {
        'http': 'http://user:pass@host:port',
        'https': 'https://user:pass@host:port',
        'no_proxy': 'localhost,127.0.0.1'
    }
}

driver = webdriver.Chrome(seleniumwire_options=options)

Quick tips

  • Set the proxy before creating the driver.
  • Make sure the proxy supports the protocol you need.
  • If websites behave oddly, check for:
    • DNS leaks
    • HTTPS certificate issues
    • WebRTC leaks in browsers
  • For headless mode, proxy settings work similarly.

If you tell me your language and browser (Chrome/Firefox/Edge) and whether your proxy needs authentication, I can give you a ready-to-run snippet.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.