1

I am adding chrome options this way and it works if I use proxy ip authentication.

    options = webdriver.ChromeOptions() 
    options.headless = True
    options.add_argument('--proxy-server=92.128.165.143:3399')
    driver = uc.Chrome(options=options)

However, I have a proxy with authentication in this format: http://username:password@91.92.128.165.143:3399

If I add it like

options.add_argument('--proxy-server=http://username:password@91.92.128.165.143:3399')

it doesn't work. How could I add it with username/password? This applies only to undetected chrome driver.

Deivydas Voroneckis
  • 1,539
  • 3
  • 15
  • 33

1 Answers1

0

Use the following code to add proxy with username and password:

from selenium import webdriver

PROXY = "http://username:password@91.92.128.165.143:3399"

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=%s' % PROXY)

driver = webdriver.Chrome(chrome_options=chrome_options)

edit:

I found this how to set proxy with authentication in selenium chromedriver python?

Carter McKay
  • 362
  • 1
  • 11