5

I have the credential of a SOCKS 5 proxy (host, port, username, password). I want to set that proxy and use with selenium-Chrome.

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType

proxy = Proxy()
proxy.socksProxy = '123.12.12.12:80'
proxy.socksUsername = 'my_username'
proxy.socksPassword = 'my_password'

capabilities = webdriver.DesiredCapabilities.CHROME
proxy.add_to_capabilities(capabilities)

driver = webdriver.Chrome(desired_capabilities=capabilities)
driver.get("https://wtfismyip.com/")

But the IP does not change. I already kwon how to set up a proxy with no auth required (just use chromedirver option --proxy-server), but this method does not accept username & password.

Any idea why this code doesn't work?

S1M0N38
  • 131
  • 2
  • 10

1 Answers1

0

Chrome doesn't support SOCKS5 proxy with authentication.