Answer the question
In order to leave comments, you need to log in
How to use proxy with selenium?
Tell me how you can add a proxy for selenium?
I am trying to use this code:
PROXY = "прокси"
firefox_options = webdriver.FirefoxOptions()
firefox_options.add_argument('--proxy-server=%s' % PROXY)
profile = webdriver.FirefoxProfile()
profile.set_preference('intl.accept_languages', 'en-US, en')
binary = FirefoxBinary(r'C:\\Program Files\\Mozilla Firefox\\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary, executable_path='C:\\geco\\geckodriver.exe',firefox_profile=profile, firefox_options=firefox_options)
browser = driver.get(" https://2ip.ru/ ")and I see that the proxy has not changed.
Answer the question
In order to leave comments, you need to log in
browser_options = Options()
browser_options.add_argument('--proxy-server=http://%s' % proxy)
browser = webdriver.Chrome(options=browser_options)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question