K
K
kopelev20002021-02-02 20:51:42
Python
kopelev2000, 2021-02-02 20:51:42

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()


Someone clearly faced with this and may know the solution, I will be glad if you share.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zlo1, 2021-02-02
@zlo1

Try proxy intermediary
3proxy can redirect requests to proxy with authorization - parent option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question