Я использую selenod и мне необходимо добавить прокси с авторизацией
proxy='1111.1111.user.pass'
path = os.path.dirname(os.path.abspath(__file__))
PROXY_HOST=proxy.split(':')[0]
PROXY_PORT=proxy.split(':')[1]
PROXY_USER=proxy.split(':')[2]
PROXY_PASS=proxy.split(':')[3]
chrome_options = webdriver.ChromeOptions()
#capabilities = dict(DesiredCapabilities.CHROME)
capabilities = {
"browserName": "UNKNOWN",
"browserVersion": "",
"selenoid:options": {
"enableVNC": True,
"enableVideo": False
}
}
capabilities['proxy'] = {'proxyType': 'MANUAL',
'httpProxy': PROXY_HOST+":"+PROXY_PORT,
'ftpProxy': PROXY_HOST+":"+PROXY_PORT,
'sslProxy': PROXY_HOST+":"+PROXY_PORT,
'noProxy': '',
'class': "org.openqa.selenium.Proxy",
'autodetect': False,
'socksUsername': PROXY_USER,
'socksPassword': PROXY_PASS}
chrome_options.add_extension(f'{path}\\Chrome\\ggmdpepbjljkkkdaklfihhngmmgmpggp-2.0-Crx4Chrome.com.crx')
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_argument("start-maximized")
ua = UserAgent()
userAgent = ua.random
while 'Windows' not in userAgent:
userAgent = ua.random
chrome_options.add_argument(f'user-agent={userAgent}')
chrome_options.add_argument('--disable-blink-features=AutomationControlled')
chrome_options.add_argument('--disable-gpu')
#chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument("disable-infobars")
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('disable-infobars')
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
chrome_options.add_experimental_option('useAutomationExtension', False)
chrome_options.add_argument("--remote-debugging-port=9222")
driver = webdriver.Remote(
command_executor="http://selenoid:4444/wd/hub",
desired_capabilities=capabilities,options=chrome_options)
получаю:
MaxRetryError("HTTPConnectionPool(host='selenoid', port=4444): Max retries exceeded with url: /wd/hub/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000020170692460>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))")
Буду благодарен любой информации