Answer the question
In order to leave comments, you need to log in
How to login to selenium proxy?
Good evening everyone! I have a problem with adding proxy in selenium.
I work with Chrome. I looked at many options on the Internet, but nothing helped, so I came here.
Here's what I've tried:
# ...
options = webdriver.ChromeOptions()
options.add_extension('proxy.zip')
# ...
driver = webdriver.Chrome(executable_path='path to chromedriver.exe')
alert = driver.switch_to_alert
alert.send_keys(login, Keys.TAB, password)
alert.accept()
webdriver.DesiredCapabilities.CHROME
Answer the question
In order to leave comments, you need to log in
from selenium import webdriver
from seleniumwire import webdriver
from webdriver_manager.chrome import ChromeDriverManager
username = ''
password = ''
ip = ''
port = ''
proxy = f'{username}:{password}@{ip}:{port}'
options = {
'proxy': {
'https': f'https://{proxy}',
}
}
driver = webdriver.Chrome(ChromeDriverManager().install(),seleniumwire_options=options)
driver.get('https://2ip.ru/')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question