Back to blog

Selenium Proxy Integration with Oxylabs

Iveta Vistorskyte


Selenium is a tool that helps automate web browser interactions for website testing and more. It’s useful when you need to interact with a browser to perform a number of tasks, such as clicking on buttons, scrolling, etc. Even if primarily Selenium is used for website testing, it can also be used for web scraping because it helps locate the required public data on a website. 

This article will go through the Selenium integration process with Oxylabs’ Residential Proxies for a smooth web scraping process.

How to integrate Oxylabs’ proxies with Selenium?

This paragraph explains how to integrate Oxylabs’ Residential Proxies with Selenium in Python. Note that the required version of Python is Python 3.5 (or higher).

Setting up Selenium

Firstly, you’ll need to install Selenium Wire to extend Selenium’s Python bindings because using the default Selenium module for implementing proxies that require authentication makes the whole process complicated. You can do it using the pip command:

pip install selenium-wire

Another recommended package for this integration is webdriver-manager. It’s a package that simplifies the management of binary drivers for different browsers. In this case, there’s no need to manually download a new version of a web driver after each update.

You can install the webdriver-manager using the pip command as well:

pip install webdriver-manager

Proxy authentication

Once everything is set up, you can move on to the next part – proxy authentication. For proxies to work, you’ll be prompted to specify your account credentials.

USERNAME = "your_username"
PASSWORD = "your_password"

You’ll need to adjust your_username and your_password fields with the username and password of your proxy user.

Testing proxy server connection

If you need to check if the proxy is working, you should visit If everything is working correctly, it will return an IP address of a proxy that you’re using.

    return f'\nYour IP is: {"[0-9].{2,}", driver.page_source).group()}'

Full code for Oxylabs’ Residential Proxies integration with Selenium

import re
from typing import Optional

from seleniumwire import webdriver
# A package to have a chromedriver always up-to-date.
from import ChromeDriverManager

USERNAME = "your_username"
PASSWORD = "your_password"

def chrome_proxy(user: str, password: str, endpoint: str) -> dict:
    wire_options = {
        "proxy": {
            "http": f"http://{user}:{password}@{endpoint}",
            "https": f"http://{user}:{password}@{endpoint}",

    return wire_options

def execute_driver():
    options = webdriver.ChromeOptions()
    options.headless = True
    proxies = chrome_proxy(USERNAME, PASSWORD, ENDPOINT)
    driver = webdriver.Chrome(
        ChromeDriverManager().install(), options=options, seleniumwire_options=proxies
        return f'\nYour IP is: {"[0-9].{2,}", driver.page_source).group()}'

if __name__ == "__main__":

Wrapping it up

Selenium is a great tool for public web scraping, especially when learning the basics. With the help of Oxylabs’ Residential Proxies, public web scraping becomes even more efficient. 

If you have any questions about integrating Oxylabs’ proxies, you can contact us at any time. You should also visit our GitHub profile for more integrations with Oxylabs’ Proxies.

About the author

Iveta Vistorskyte

Lead Content Manager

Iveta Vistorskyte is a Lead Content Manager at Oxylabs. Growing up as a writer and a challenge seeker, she decided to welcome herself to the tech-side, and instantly became interested in this field. When she is not at work, you'll probably find her just chillin' while listening to her favorite music or playing board games with friends.

All information on Oxylabs Blog is provided on an "as is" basis and for informational purposes only. We make no representation and disclaim all liability with respect to your use of any information contained on Oxylabs Blog or any third-party websites that may be linked therein. Before engaging in scraping activities of any kind you should consult your legal advisors and carefully read the particular website's terms of service or receive a scraping license.

Related articles

Get the latest news from data gathering world

I’m interested


  • How to integrate Oxylabs’ proxies with Selenium?

  • Full code for Oxylabs’ Residential Proxies integration with Selenium

  • Wrapping it up

Scale up your business with Oxylabs®