Answer the question
In order to leave comments, you need to log in
Is it possible to connect socks proxy with authorization to chromedriver?
Is it possible to connect socks proxy with authorization to chromedriver?
I use selenium + python for parsing and there was a need to connect proxies, no matter how much I searched, I didn’t find anything to help me. I tried to run the code from https://botproxy.net/docs/how-to/setting-chromedri... , no effect (nothing happens, as if nothing was connected), in all other cases it gave an error ERR_TUNNEL_CONNECTION_FAILED.
From the last thing I tried, it connected the extension https://www.crx4chrome.com/crx/1446/ but the same error.
THE CODE:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from time import sleep
proxy = {'address': IP:PORT',
'username': 'login',
'password': 'password'}
capabilities = dict(DesiredCapabilities.CHROME)
capabilities['proxy'] = {'proxyType': 'MANUAL',
'httpProxy': proxy['address'],
'ftpProxy': proxy['address'],
'sslProxy': proxy['address'],
'noProxy': '',
'class': "org.openqa.selenium.Proxy",
'autodetect': False,
'socksUsername': proxy['username'],
'socksPassword': proxy['password']}
options = Options()
options.add_extension("D:\\UB\\extension_2_0_0_0.crx")
driver = webdriver.Chrome(options=options, executable_path="D:\\chromedriver\\chromedriver.exe", desired_capabilities=capabilities)
driver.get('https://www.google.com/search?q=my+ip+address')
driver.close()
driver.quit()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question