Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webdriver and proxy server for firefox

are there any ways to set firefox's proxy settings? I found here information about FoxyProxy but when Selenium works, plugins are unactivated in window.

like image 604
Max Frai Avatar asked May 22 '10 11:05

Max Frai


People also ask

What is the WebDriver for Firefox?

Selenium uses W3C Webdriver protocol to send requests to GeckoDriver, which translates them into a protocol named Marionette. Even if you are working with older versions of Firefox browser, Selenium 3 expects you to set path to the driver executable by the webdriver. gecko. driver.

How do I get Firefox WebDriver?

Step 1: Navigate to the official Selenium website. Under third-party drivers, one will find all the drivers. Just click on the Mozilla GeckoDriver documentation as shown below. Now, it will navigate to the GeckoDriver downloads link, where one can download the suitable driver based on the OS as it is platform agnostic.

Can you use proxies with Selenium?

The best way to integrate authenticated proxies with Selenium is by using PhantomJS as a headless browser instead of the Chrome WebDriver. However, it is also possible to add a browser extension that does the authentication for Selenium.


1 Answers

Value for network.proxy.http_port should be integer (no quotes should be used) and network.proxy.type should be set as 1 (ProxyType.MANUAL, Manual proxy settings)

FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("network.proxy.type", 1); profile.setPreference("network.proxy.http", "localhost"); profile.setPreference("network.proxy.http_port", 3128); WebDriver driver = new FirefoxDriver(profile); 
like image 110
Benjan Tom Avatar answered Oct 19 '22 19:10

Benjan Tom