-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
What happened?

I am using a proxy network and want to configure it with Selenium on Python. I have seen many resources use the HOST:PORT method of configuration, but proxy networks uses the "URL method" of http://USER:PASSWORD@PROXY:PORT.
See different types of configurations below:
How can we reproduce the issue?
###Selenium_Options###
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("--proxy-server=http://USER:PASSWORD@PROXY:PORT")
driver = webdriver.Chrome(options=options)
driver.get("https://some_url.com")
###Desired_Capabilities###
from selenium import webdriver
from selenium.webdriver.common.proxy import *
proxy_url = "http://USER:PASSWORD@PROXY:PORT"
proxy = Proxy({
'proxyType': ProxyType.MANUAL,
'httpProxy': proxy_url,
'sslProxy': proxy_url,
'noProxy': ''})
capabilities = webdriver.DesiredCapabilities.CHROME
proxy.add_to_capabilities(capabilities)
driver = webdriver.Chrome(desired_capabilities=capabilities)
driver.get("https://some_url.com")Relevant log output
Log does not throw any errors with the above configurations, all the errors on on a browser side:
Reference above attached image for Selenium_Options error.
Desired Capabilities does not throw any browser errors, but the configuration still fails to add proxy.
*Proxy "URL" is in a working state and has been tested using the requests library.
FOR MORE INFORMATION: https://stackoverflow.com/questions/70806778/python-selenium-proxy-network
Operating System
Windows 10
Selenium version
Tried with: 3.141.0 and 4.0.0a7
What are the browser(s) and version(s) where you see this issue?
Version 101.0.4951.41
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 101.0.4951.41
Are you using Selenium Grid?
NA