How to connect to GoProxies proxy via Selenium?
pip install selenium-wirepip install webdriver-managerfrom 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())PreviousHow to connect to GoProxies proxy via ZeroOmega (Proxy SwitchyOmega 3)NextHow to connect to GoProxies via IP Burger extension?
Last updated
Was this helpful?

