RemoteWebdriver launched with PhantomJS does not open https url

I am using selenium with PhantomJs to clear the URL. I initialized the driver as shown below

final DesiredCapabilities caps = DesiredCapabilities.chrome();
caps.setCapability(
        PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
        "PhantomJsPath");
caps.setCapability("page.settings.loadImages", false);
caps.setCapability("trustAllSSLCertificates", true);

RemoteWebDriver driver = new PhantomJSDriver(caps);
driver.setLogLevel(Level.OFF);
driver.get("https://.......")

Source received from driver empty      

Did I miss something?

+4
source share
1 answer

Recently, the POODLE vulnerability has forced sites to remove SSLv3 support. Since PhantomJS <v1.9.8 uses SSLv3 by default, the page cannot be loaded. To fix this, you need to start PhantomJS with --ssl-protocol=tlsv1or --ssl-protocol=any. See this answer for a simple PhantomJS.

caps = DesiredCapabilities.phantomjs(); // or new DesiredCapabilities();
caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, 
        new String[] {"--ssl-protocol=tlsv1"});
// other capabilities
driver = new PhantomJSDriver(caps);

If this does not solve the problem, you can also add

"--web-security=false", "--ignore-ssl-errors=true"

String cli, SiKing .

+7

All Articles