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.

In this guide, we will use Python to demonstrate the integration of Oculus Proxies with Selenium.

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.

How to Integrate Oculus Proxies With Selenium

1

Install the Required Tools

1. Install Python: Download and install Python from python.org.

2. Install Selenium: Open your terminal and run:

pip install selenium

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

pip install webdriver-manager
2

Access Your Oculus Proxy Credentials

Log in to your Oculus Dashboard 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:

proxy_host = "proxy.oculus-proxy.com"
proxy_port = "12345"
proxy_username = "your-username"
proxy_password = "your-password"
3

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:

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()
4

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, which shows the IP address used for the request.

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

Example Output:

{
  "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.