Answer the question
In order to leave comments, you need to log in
Proxy with selenium firefox authorization?
I'm trying to access a site using a proxy with authorization, but the proxy is simply not being used
path = os.path.dirname(os.path.abspath(__file__))
host=proxy.split(':')[0]
port=int(proxy.split(':')[1])
username=proxy.split(':')[2]
password=proxy.split(':')[3]
myProxy = f"{username}:{password}@{host}:{port}"
proxym = Proxy({
'proxyType': ProxyType.MANUAL,
'httpProxy': myProxy,
'ftpProxy': myProxy,
'sslProxy': myProxy,
'noProxy': '' # set this value as desired
})
driver = webdriver.Firefox(executable_path=os.path.join(path, 'geckodriver.exe'),firefox_binary=os.path.join(path, 'Mozilla Firefox\\firefox.exe'), proxy=proxym)
from seleniumwire import webdriver
options = {
'proxy': {
'http': 'http://username:[email protected]:port',
'https': 'https://username:[email protected]:port',
'no_proxy': 'localhost,127.0.0.1,dev_server:8080'
}
}
driver = webdriver.Firefox(seleniumwire_options=options)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question