Hype Proxies

How to use a proxy with Selenium

This guide walks you through integrating HypeProxies with Selenium to bypass IP restrictions, overcome geo-targeting, and manage rate limiting in web scraping workflows.

Speed

Success

Consistency

Reliability

Flexibility

Prerequisites

Before integrating proxies into Selenium, ensure your development environment is properly configured.

Selenium installation

Install Selenium and confirm it runs locally. If you’re new to Selenium, start with the official installation guide.

Selenium homepage mockup

HypeProxies setup

You’ll need active proxy credentials from your HypeProxies dashboard:

  1. Log in to your HypeProxies dashboard (or create an account). New users can also request a 24-hour trial.

  2. Choose the right proxy type for your workflow and purchase a plan that fits your needs – ISP proxies, sneaker proxies, or ticket proxies.

Locate your active proxies in the dashboard, formatted as IP:PORT:USERNAME:PASSWORD.

Hypeproxies dashboard mockup

Tip – use the proxy checker tool to verify connectivity before implementation.

Setting up one proxy

Selenium can set a proxy host/port, but it doesn’t offer a clean, cross-browser way to pass HTTP proxy usernames and passwords – you’ll often hit a native auth pop-up. Selenium Wire extends WebDriver and exposes network requests. It also simplifies authenticated proxy setup – pass a proxy URL with credentials, and it adds the correct Proxy-Authorization header for you.

Install Selenium Wire. Pin blinker to avoid import errors:

pip install selenium-wire "blinker<1.8" setuptools

Here's the code:

from seleniumwire import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

PROXY_HOST = "YOUR_PROXY_HOST"
PROXY_PORT = "YOUR_PROXY_PORT"
PROXY_USER = "YOUR_PROXY_USERNAME"
PROXY_PASS = "YOUR_PROXY_PASSWORD"

proxy_url = f"http://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}"

seleniumwire_options = {
    "proxy": {
        "http": proxy_url,
        "https": proxy_url,
    }
}

chrome_opts = ChromeOptions()
chrome_opts.add_argument("--headless=new")  # optional

driver = webdriver.Chrome(
    options=chrome_opts, seleniumwire_options=seleniumwire_options
)

driver.get("https://ipapi.co/json/")
print(driver.page_source)  # should show the proxy's IP/location

driver.quit()

When you run the code, the output will be:

Output

This shows your proxy's IP address (68.182.95.4) located in New York City, confirming that the proxy authentication is working correctly through Selenium Wire.

Troubleshooting connection failures – If you encounter ERR_TUNNEL_CONNECTION_FAILED or ERR_TIMED_OUT errors:

  • Verify that your proxy credentials haven’t expired

  • Test connectivity using the HypeProxies checker tool

  • Try a different proxy from your pool

Rotating multiple proxies

A single exit IP is an easy target for rate limits and soft bans. Rotating proxies spreads requests across many identities – lowering block rates, smoothing throughput, and keeping your session graph boringly normal.

Here's the code:

from seleniumwire import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
import time
import json

# Replace with your actual proxy credentials
PROXIES = [
    "PROXY_HOST_1:PROXY_PORT_1:USERNAME:PASSWORD",
    "PROXY_HOST_2:PROXY_PORT_2:USERNAME:PASSWORD",
    "PROXY_HOST_3:PROXY_PORT_3:USERNAME:PASSWORD",
    "PROXY_HOST_4:PROXY_PORT_4:USERNAME:PASSWORD",
]


def create_driver_with_proxy(proxy_str):
    host, port, user, password = proxy_str.split(":")
    proxy_url = f"http://{user}:{password}@{host}:{port}"

    seleniumwire_options = {
        "proxy": {
            "http": proxy_url,
            "https": proxy_url,
        }
    }

    chrome_opts = ChromeOptions()
    chrome_opts.add_argument("--headless=new")

    return webdriver.Chrome(
        options=chrome_opts, seleniumwire_options=seleniumwire_options
    )


# Rotate through each proxy
for i, proxy in enumerate(PROXIES):
    print(f"\nUsing proxy {i+1}: {proxy.split(':')[0]}")

    driver = create_driver_with_proxy(proxy)
    driver.get("https://ipapi.co/json/")

    # Parse and display clean output
    response_data = json.loads(driver.page_source.split("<pre>")[1].split("</pre>")[0])
    print(f"Proxy {i+1} IP: {response_data['ip']}")

    driver.quit()
    time.sleep(2)  # Wait between rotations

The output would be – you can see IP addresses changing with each rotation:

Output

For production use, consider connection pooling, async requests, error handling with failover, and proxy health monitoring to scale beyond this basic approach.

Note – the original Selenium Wire is no longer actively maintained (archived January 2024). Consider using the maintained fork selenium-wire-2 for new projects.

SeleniumBase – the easier alternative

SeleniumBase is a maintained Python framework built on top of Selenium. It simplifies proxy usage and adds stealth features (UC/CDP) for tougher targets.

Why SeleniumBase:

  • Native authenticated proxy support 

  • Actively maintained 

  • Built-in stealth mode

  • Zero driver hassle

Simply install it via:

pip install seleniumbase

Here’s an example showing an authenticated proxy in one line:

from seleniumbase import SB

# One line handles proxy auth, headless, and stealth
with SB(uc=True, headless=True, proxy="USERNAME:PASSWORD@HOST:PORT") as sb:
    sb.open("https://ipapi.co/json/")
    print(sb.get_page_source())

Learn more – SeleniumBase docs

Best practices

Follow these best practices for stable and responsible proxy scraping:

  • Proxy rotation. Rotate through multiple proxies to distribute load and avoid rate limits.

  • Error handling. Implement retry logic to skip failed proxies and continue scraping.

  • Resource cleanup. Always call driver.quit() to prevent memory leaks and zombie processes.

  • Request spacing. Add delays between requests to avoid overwhelming target sites.

  • Compliance. Respect robots.txt, terms of service, and rate limits of target websites.

  • Stay current. Tools change fast – always check official docs and explore maintained open-source projects (e.g., SeleniumBase, selenium-wire-2, proxy-chain) to keep your stack resilient.

Getting support

Need help with your proxy integration? The HypeProxies team provides support through several channels:

Ready to scale your web scraping with reliable, high-performance proxies? Get started with HypeProxies.

Share on

Stay in the loop

Subscribe to our newsletter for the latest updates, product news, and more.

No spam. Unsubscribe at anytime.

What our clients are saying

What our clients are saying

What our clients are saying

Fast static residential IPs

Proxy plans

Quarterly

10% Off

Monthly

Best value

Starter

Perfect for testing and low-scale usage

$1.40

/ IP

$1.24

/ IP

$35

/month

$31

/month

Quarterly

Cancel at anytime

Pro

Balanced option for daily proxy needs

$1.30

/ IP

$1.16

/ IP

$65

/month

$58

/month

Quarterly

Cancel at anytime

Business

Built for scale and growing demand

$1.25

/ IP

$1.12

/ IP

$125

/month

$112

/month

Quarterly

Cancel at anytime

Enterprise

High-volume power for heavy users

$1.18

/ IP

$1.06

/ IP

$300

/month

$270

/month

Quarterly

Cancel at anytime

Proxies

Bandwidth

Threads

Speed

Support

25 IPs

Unlimited

Unlimited

10GBPS

Standard

50 IPs

Unlimited

Unlimited

10GBPS

Standard

100 IPs

Unlimited

Unlimited

10GBPS

Priority

254 IPs

Subnet

/24 private subnet
on dedicated servers

Unlimited

Unlimited

10GBPS

Dedicated

Crypto

Quarterly

10% Off

Monthly

Starter

Perfect for testing and low-scale usage

$1.40

/ IP

$1.24

/ IP

$35

/month

$31

/month

Quarterly

Cancel at anytime

Get discount below

Proxies

25 IPs

Bandwidth

Unlimited

Threads

Unlimited

Speed

10GBPS

Support

Standard

Pro

Balanced option for daily proxy needs

$1.30

/ IP

$1.16

/ IP

$65

/month

$58

/month

Quarterly

Cancel at anytime

Get discount below

Proxies

50 IPs

Bandwidth

Unlimited

Threads

Unlimited

Speed

10GBPS

Support

Standard

Popular

Business

Built for scale and growing demand

$1.25

/ IP

$1.12

/ IP

$125

/month

$112

/month

Quarterly

Cancel at anytime

Get discount below

Proxies

100 IPs

Bandwidth

Unlimited

Threads

Unlimited

Speed

10GBPS

Support

Priority

Enterprise

High-volume power for heavy users

$1.18

/ IP

$1.06

/ IP

$300

/month

$270

/month

Quarterly

Cancel at anytime

Get discount below

Proxies

254 IPs

Subnet

/24 private subnet
on dedicated servers

Bandwidth

Unlimited

Threads

Unlimited

Speed

10GBPS

Support

Dedicated

Crypto

Quarterly

10% Off

Monthly

Starter

Perfect for testing and low-scale usage

$1.40

/ IP

$1.24

/ IP

$35

/month

$31

/month

Quarterly

Cancel at anytime

Get discount below

Proxies

25 IPs

Bandwidth

Unlimited

Threads

Unlimited

Speed

10GBPS

Support

Standard

Pro

Balanced option for daily proxy needs

$1.30

/ IP

$1.16

/ IP

$65

/month

$58

/month

Quarterly

Cancel at anytime

Get discount below

Proxies

50 IPs

Bandwidth

Unlimited

Threads

Unlimited

Speed

10GBPS

Support

Standard

Popular

Business

Built for scale and growing demand

$1.25

/ IP

$1.12

/ IP

$125

/month

$112

/month

Quarterly

Cancel at anytime

Get discount below

Proxies

100 IPs

Bandwidth

Unlimited

Threads

Unlimited

Speed

10GBPS

Support

Priority

Enterprise

High-volume power for heavy users

$1.18

/ IP

$1.06

/ IP

$300

/month

$270

/month

Quarterly

Cancel at anytime

Get discount below

Proxies

254 IPs

Subnet

/24 private subnet
on dedicated servers

Bandwidth

Unlimited

Threads

Unlimited

Speed

10GBPS

Support

Dedicated

Crypto