0

I try to connect http://username:password@ip:port proxy and options.add_argument(f'--proxy-server=%s' % proxy) not working. Can you help me?..

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

To connect a proxy through ChromeDriver you can use the following code block:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

PROXY = "ip:port"
options = Options()
options.add_argument('--proxy-server=%s' % PROXY)
driver = webdriver.Chrome(options=options, executable_path=r'C:\path\to\chromedriver.exe')
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352