0

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")
1
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)

Not the answer you're looking for? Browse other questions tagged or ask your own question.