Webdriver and proxy server for firefox

后端 未结 13 2369
清歌不尽
清歌不尽 2020-11-30 23:49

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.

13条回答
  •  没有蜡笔的小新
    2020-12-01 00:16

    Firefox Proxy: JAVA

    String PROXY = "localhost:8080";
    
    org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
    
    proxy.setHttpProxy(PROXY)setFtpProxy(PROXY).setSslProxy(PROXY);
    
    DesiredCapabilities cap = new DesiredCapabilities();
    
    cap.setCapability(CapabilityType.PROXY, proxy); 
    
    WebDriver driver = new FirefoxDriver(cap);
    

提交回复
热议问题