LogoLogo
  • Welcome!
  • Proxies
    • Dedicated DataCenter Proxies
      • Intro
      • Proxy parameters
        • Country
        • State
        • City
        • Session Stickiness
        • List of client's IPs
    • Rotating Residential Proxies
      • Intro
      • Proxy parameters
        • Country
        • State
        • City
        • Session Stickiness
        • ASN targeting
    • ISP Residential Proxies
      • Intro
      • Proxy parameters
        • Session Stickiness
        • Country
        • State
        • City
    • Shared DataCenter Proxies
      • Intro
      • Proxy parameters
        • Country
        • State
        • City
        • Session Stickiness
    • Integrations
      • How to rotate proxies in Python?
      • How to use GoProxies in Ruby?
      • How to connect to GoProxies proxy via SmartProxy?
      • How to connect to GoProxies proxy via ZeroOmega (Proxy SwitchyOmega 3)
      • How to connect to GoProxies proxy via Selenium?
      • How to connect to GoProxies via IP Burger extension?
      • How to connect to GoProxies via Puppeteer?
      • How to connect to GoProxies proxy via FoxyProxy?
    • Resellers API
      • How to login into GoProxies API and list your current sub-users?
      • How to create a sub-user via GoProxies API?
      • How to check usage traffic of the sub-user?
    • HTTP Error Response codes
    • FAQ
      • General Questions
        • What solutions do GoProxies offer?
        • Is there an option to purchase a custom proxy package?
        • Can you transfer my unused traffic to next month?
        • Does GoProxies have customer support?
        • Do you charge additional fees for the setup?
        • Can I cancel my subscription at any time?
      • Billing and Pricing
        • What are the GoProxies pricing plans?
        • What payment methods do you accept?
      • Static Residential Proxies
        • Which locations GoProxies covers with Static Residential Proxies?
        • Do you offer a free trial for Static Residential Proxies?
      • Rotating Residential Proxies
        • What locations GoProxies covers with Rotating Residential Proxies?
        • What HTTP(s) ports do you allow access to?
        • Is it possible to rotate the Residential IP every request?
        • How many concurrent sessions can I make?
    • Contact Support
Powered by GitBook
On this page

Was this helpful?

  1. Proxies
  2. Integrations

How to connect to GoProxies proxy via Selenium?

PreviousHow to connect to GoProxies proxy via ZeroOmega (Proxy SwitchyOmega 3)NextHow to connect to GoProxies via IP Burger extension?

Last updated 4 months ago

Was this helpful?

Selenium is a tool that helps automate web browser interactions for website testing and more.

To integrate Selenium with GoProxies, you would need to follow the steps below:

  • Firstly, you would need to install to extend Selenium's Python bindings, since using the default Selenium module for implementing proxies that require authentication makes it complicated. You can do it using the pip command:

pip install selenium-wire
  • Another package which is recommended 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
  • Specify your account credentials for proxies to work:

Firstly, you would need to replace 'your_username' and 'your_password' with your credentials.

Then you need to specify the endpoint, in this example we're using 'proxy.goproxies.com:1080'

  • The full example of a code should look like this:

from selenium.webdriver.common.by import By
from seleniumwire import webdriver
# A package to have a chromedriver always up-to-date.
from webdriver_manager.chrome import ChromeDriverManager

USERNAME = "your_username"
PASSWORD = "your_password"
ENDPOINT = "proxy.goproxies.com:1080"
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
    )
    try:
        driver.get("https://ip.goproxies.com/")
        return f'\nYour IP is: {driver.find_element(By.CSS_SELECTOR, "body").text}'
    finally:
        driver.quit()

if __name__ == "__main__":
    print(execute_driver())

That's it! You've set-up GoProxies via Selenium.

Selenium Wire