Answer the question
In order to leave comments, you need to log in
How to use authorization proxy in Selenium with Firefox in Python?
How to use authorized proxy with Selenium and Firefox in Python?
Here are the versions used:
from selenium import webdriver
proxy_host = "196.19.8.88"
proxy_port = 8000
fp = webdriver.FirefoxProfile()
fp.set_preference("network.proxy.type", 1)
fp.set_preference("network.proxy.http", proxy_host)
fp.set_preference("network.proxy.http_port", proxy_port)
fp.set_preference("network.proxy.https", proxy_host)
fp.set_preference("network.proxy.https_port", proxy_port)
fp.set_preference("network.proxy.ssl", proxy_host)
fp.set_preference("network.proxy.ssl_port", proxy_port)
fp.set_preference("network.proxy.ftp", proxy_host)
fp.set_preference("network.proxy.ftp_port", proxy_port)
fp.set_preference("network.proxy.socks", proxy_host)
fp.set_preference("network.proxy.socks_port", proxy_port)
fp.update_preferences()
driver = webdriver.Firefox(firefox_profile=fp)
driver.get('http://www.myip.dk/')
print(driver.find_element_by_id('ipv4address').find_element_by_tag_name('p').text)
driver.quit()
Answer the question
In order to leave comments, you need to log in
As a result, I decided to use a service that provides a proxy with binding to ip. That is, the need for authorization simply disappeared
Maybe it's easier to use Chrome? with the right user agent?
will be enough
service_args = [
'--proxy=192.168.0.1:3128',
'--proxy-auth=login:pass'
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question