Y
Y
yraiv2022-04-10 08:13:29
Google Chrome
yraiv, 2022-04-10 08:13:29

How to use proxy with password in Selenium?

How can I use a proxy with a password and login?
I use proxy like this

options.AddArguments("--proxy-server=http://Тут прокси мои");

but when the page is loaded (I use google chrome), a window appears where you need to enter the password and login from the proxy. I do it manually and everything works, but how can I do it automatically?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bla Bla, 2022-04-10
@SubUser

Only use seleniumwire, in fact the same as selenium but improved.

from seleniumwire import webdriver

proxies = 'http://myusername:[email protected]:123456'
options = {
        'proxy': {
            'http':  proxies,
            'https': proxies
        }  
    }

chrome_options = webdriver.ChromeOptions()

driver = webdriver.Chrome('chromedriver', options=chrome_options,seleniumwire_options=options)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question