Selenium chrome driver socks proxy configuration

后端 未结 3 1936
时光取名叫无心
时光取名叫无心 2021-02-18 18:21

I am having troubles in setting socks proxy for chrome driver

Proxy proxy = new Proxy();
proxy.setProxyType(Proxy.ProxyType.MANUAL);
proxy.setAutodetect(false);
         


        
3条回答
  •  我在风中等你
    2021-02-18 18:44

        ChromeOptions options = new ChromeOptions();
        options.addArguments("--proxy-server=socks5://" + host + ":" + port);
        WebDriver driver = new ChromeDriver(options);
    

提交回复
热议问题