1

I'm trying to use HTTP proxy in Selenium with Chrome, and i'm getting selenium.common.exceptions.WebDriverException: Message: unknown error: net::ERR_PROXY_CONNECTION_FAILED error. I've tried to add ['acceptSslCerts'] = True capability, but it give no result. I'm using HTTP proxy from HideMyName free proxies list. When i'm using HTTPS proxy, everything is okay. Image of Chrome: enter image description here

Code:

curr_prox = random.choice(proxy_list)
caps = webdriver.DesiredCapabilities.CHROME

opts = Options()
opts.add_argument("user-agent="+UserAgent().chrome)
caps['proxy'] = {
    "httpProxy": curr_prox,
    "ftpProxy": curr_prox,
    "sslProxy": curr_prox,
    "proxyType": "MANUAL",
}
caps['acceptSslCerts'] = True

driver = webdriver.Chrome(executable_path="chromedriver.exe", desired_capabilities=caps, options=opts)

driver.get("https://2ip.ru")
  • You might want to check out: https://stackoverflow.com/a/48498403/7058266 which uses ``--proxy-server`` to set the proxy server via Chrome options instead. – Michael Mintz Jan 15 '22 at 14:28

1 Answers1

0

Try using the http proxy using the browser profile:

profile = webdriver.ChromeProfile()
host = 127.0.0.1 # The proxy host
port = 8080 # The proxy port
profile.set_preference('network.proxy.type', 1)
profile.set_preference('network.proxy.http', host)
profile.set_preference('network.proxy.http_port', port)
driver = webdriver.Chrome(profile)
Louis_45
  • 11
  • 2