python + selenium + proxy + cert authorization problem

346 views Asked by At

Windows 10 + local account. Edge 120.0.2210.77 Internet via proxy, login/pass auth required, certificate for proxy antivirus required. Internet works well, except i can't run python/selenium script. Microsoft Edge WebDriver 120.0.2210.144

This code

from selenium import webdriver
edge_options = Options()
edge_options.add_argument("--proxy-server=http://mylogin:[email protected]:3128");
RR = webdriver.Edge(options=edge_options) **## Exception on this string**

rises exception

Exception managing MicrosoftEdge: error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_120_WINDOWS): error trying to connect: proxy authentication required
Error sending stats to Plausible: error sending request for url (https://plausible.io/api/event): error trying to connect: proxy authentication required
exception <class 'selenium.common.exceptions.NoSuchDriverException'>
    description:    Message: Unable to obtain driver for MicrosoftEdge using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

I see obvios reason: i didn't specify certificate location, but i don't know khow to do it.

I.e. to get pip works i should run

pip list --outdated --proxy http://mylogin:[email protected]:3128 --cert c:\0.crt

Env var SE_PROXY=http://mylogin:[email protected]:3128 doesn't help. This code

PROXY = "<HOST:PORT>"
webdriver.DesiredCapabilities.EDGE['proxy'] = {
"httpProxy": PROXY,
"ftpProxy": PROXY,
"sslProxy": PROXY,
"proxyType": "MANUAL",

}

doesn't help too.

I'd prefer to disable selenium manager - is it possible?

0

There are 0 answers