> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oculusproxies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Set Up Oculus Proxies With Selenium

> Boost your web automation! By integrating Oculus Proxies with Selenium, you can enhance privacy, bypass restrictions, and reduce the risk of IP bans during web scraping and automation tasks. This guide walks you through the step-by-step configuration process to set up Oculus Proxies with Selenium.

<img src="https://mintcdn.com/oculus/4CVh05wC6-hsrqWV/integration-guides/img/oculus_integrations/Selenium.png?fit=max&auto=format&n=4CVh05wC6-hsrqWV&q=85&s=2982dfa514e9e224ec1fb0eb555f7b1e" alt="title" width="720" height="200" data-path="integration-guides/img/oculus_integrations/Selenium.png" />

## What is Selenium?

**Selenium** is a powerful and widely-used framework for web automation and testing. It allows developers to programmatically interact with web browsers, making it ideal for tasks like:

* **Web Scraping**: Extracting data from websites.

* **Form Filling**: Automating user input processes.

* **Automated Testing**: Testing web applications across multiple browsers.

Selenium supports multiple programming languages (Python, Java, C#, etc.) and browsers (Chrome, Firefox, Edge), making it highly flexible and developer-friendly.

<Note>
  In this guide, we will use **Python** to demonstrate the integration of Oculus Proxies with Selenium.
</Note>

<Tip>
  If you're using **Oculus** to access search engines like **Google, Bing, or Yandex** and facing connection issues, the proxy type could be the reason. **ISP Premium Proxies** ensure stable and unrestricted access, preventing blocks that standard proxies might encounter. Switching to **ISP Premium Proxies** can help maintain smooth and reliable performance.
</Tip>

## How to Integrate Oculus Proxies With Selenium

<Steps>
  <Step title="Install the Required Tools">
    1\. **Install Python**: Download and install Python from [python.org](https://www.python.org/).

    2\. **Install Selenium**: Open your terminal and run:

    ```bash theme={null}
    pip install selenium
    ```

    3\. **Install WebDriver**: For Chrome, download **ChromeDriver** manually or simplify management with `webdriver-manager`:

    ```bash theme={null}
    pip install webdriver-manager
    ```
  </Step>

  <Step title="Access Your Oculus Proxy Credentials">
    Log in to your [Oculus Dashboard](https://oculusproxies.com/dashboard/page/plans) to access the following details:

    * **Host**: `proxy.oculus-proxy.com`

    * **Port**: The port number provided in your dashboard.

    * **Username**: Your Oculus proxy username.

    * **Password**: Your Oculus proxy password.

    Define these credentials in your Python script:

    ```python theme={null}
    proxy_host = "proxy.oculus-proxy.com"
    proxy_port = "12345"
    proxy_username = "your-username"
    proxy_password = "your-password"
    ```
  </Step>

  <Step title="Configure Selenium for Oculus Proxies">
    Set up proxy details in the browser’s WebDriver configuration. The example below demonstrates how to configure proxies with **ChromeDriver**.

    **Example Code:**

    ```python theme={null}
    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    from selenium.webdriver.chrome.options import Options
    from webdriver_manager.chrome import ChromeDriverManager

    # Set up proxy details
    proxy_host = "proxy.oculus-proxy.com"
    proxy_port = "12345"
    proxy_username = "your-username"
    proxy_password = "your-password"

    # Format the proxy string
    proxy = f"http://{proxy_username}:{proxy_password}@{proxy_host}:{proxy_port}"

    # Configure Chrome options
    chrome_options = Options()
    chrome_options.add_argument(f"--proxy-server={proxy}")  # Add proxy to Chrome options

    # Initialize Chrome WebDriver with the proxy
    service = Service(ChromeDriverManager().install())
    driver = webdriver.Chrome(service=service, options=chrome_options)

    # Open a test website to verify the proxy
    driver.get("https://httpbin.org/ip")  # Displays the IP address used for the request
    print(driver.page_source)  # Print the page content to verify the proxy is working

    # Close the browser
    driver.quit()
    ```
  </Step>

  <Step title="Run and Verify the Proxy Setup">
    1\. Save the script and run it in your Python environment.

    2\. The browser will open [https://httpbin.org/ip](https://httpbin.org/ip), which shows the IP address used for the request.

    3\. Confirm the displayed IP matches the Oculus Proxy details.

    **Example Output:**

    ```json theme={null}
    {
      "origin": "123.45.67.89"
    }
    ```

    **Congratulations!** You’ve successfully integrated **Oculus Proxies** with **Selenium**. This setup allows you to automate tasks like web scraping and data collection while ensuring secure and anonymous connections.
  </Step>
</Steps>
