Python Selenium - how to set up a proxy server for Firefox (geckodriver)
Hello,
how to set up for firefox (geckodriver) proxy server when using Python Selenium?
I would like to avoid blocking the source IP address where the python script is running with selenium. Thank you
Hi,
To set up a proxy for firefox (geckodriver) using Python Selenium, follow these steps:
how to set up for firefox (geckodriver) proxy server when using Python Selenium?
I would like to avoid blocking the source IP address where the python script is running with selenium. Thank you
REPLY
Hi,
To set up a proxy for firefox (geckodriver) using Python Selenium, follow these steps:
proxy = '8.8.8.8:1080'
firefox_capabilities = webdriver.DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
firefox_capabilities['proxy'] = {
"proxyType": "MANUAL",
"httpProxy": proxy,
"ftpProxy": proxy,
"sslProxy": proxy
}
driver = webdriver.Firefox(capabilities=firefox_capabilities)