Java Selenium ChromeDriver Proxy

By | July 12, 2018
Questions:

every time I start the program comes error: no Internet connection.

    public static void main(String[] args) {

    startChromeBrowser();

}

public static void startChromeBrowser(){

    System.setProperty("webdriver.chrome.driver", "E:\\chromedriver.exe");        
    ChromeOptions options = new ChromeOptions();
    options.addArguments("--proxy-server=socks5://212.62.95.45:1080");
    WebDriver driver = new ChromeDriver(options);
    driver.get("https://www.google.de");

}

Without this code code it works.

            options.addArguments("--proxy-server=socks5://212.62.95.45:1080");

I tried with multiple proxy servers.
Can someone help me out? Thanks.

Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *