🎁 Free Trial: Register now to claim 1GB Global Traffic (Valid 7 days).Get Free Traffic

Selenium Integration

Selenium WebDriver proxy setup: Python, Java, Node.js β€” one residential IP config

BytesFlows residential proxies work with all Selenium language bindings via ChromeOptions or FirefoxOptions. No third-party library β€” standard WebDriver capability injection at browser launch.

Selenium proxy configuration across languages

BytesFlows uses standard HTTP proxy settings compatible with all WebDriver implementations.

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

PROXY_HOST = 'p1.bytesflows.com'
PROXY_PORT = 8001
PROXY_USER = 'YOUR_USER'
PROXY_PASS = 'YOUR_PASS'

options = Options()
options.add_argument(f'--proxy-server=http://{PROXY_HOST}:{PROXY_PORT}')
# Note: Chrome doesn't support proxy auth via args directly
# Use a proxy extension or the manual approach below for auth

driver = webdriver.Chrome(options=options)

# For authenticated proxy, use CDP command:
driver.execute_cdp_cmd('Network.setExtraHTTPHeaders', {
    'headers': {
        'Proxy-Authorization': 'Basic ' + __import__('base64')
            .b64encode(f'{PROXY_USER}:{PROXY_PASS}'.encode())
            .decode()
    }
})

driver.get('https://httpbin.org/ip')
print(driver.find_element('tag name', 'body').text)
driver.quit()

Chrome does not support proxy authentication via command-line args. Use CDP Network.setExtraHTTPHeaders to inject the Proxy-Authorization header, or use a proxy extension (see seleniumwire approach).

How Selenium routes requests through BytesFlows

Selenium delegates all network requests to the underlying browser engine, which respects proxy configuration set via ChromeOptions or FirefoxOptions.

πŸ€–

WebDriver script

Python/Java/Node.js script launches the browser with proxy options via ChromeOptions or FirefoxOptions.

🌐

Browser engine

Chrome or Firefox reads the --proxy-server flag and routes all page requests through the configured proxy.

πŸ”

BytesFlows gateway

Gateway authenticates the request using sub-user credentials and selects a residential node matching the geo parameters.

🏠

Residential exit

All page requests exit through a real home broadband IP. The target site sees organic residential traffic.

Selenium 4+ supports CDP (Chrome DevTools Protocol) directly β€” use it for proxy authentication injection without external libraries.

Selenium proxy technical FAQ

Upgrade your Selenium scripts with residential IPs

1 GB free β€” test all four code examples above without any cost.