Selenium Webdriver + PhantomJS remains at about:blank for a specific site

后端 未结 5 1494
星月不相逢
星月不相逢 2020-12-03 21:45

I am trying to use PhantomJS with Selenium Webdriver and got success but for a specific website I see that it does not navigate to the URL. I have tried it with both Python

5条回答
  •  天涯浪人
    2020-12-03 22:01

    For me, the solution was as follows:

    var service = PhantomJSDriverService.CreateDefaultService();
    service.SslProtocol = "tlsv1"; //"any" also works
    
    driver = new PhantomJSDriver(service);
    

    I have no idea why the default sslv3 will not work. If you are sure the SSL certificates are valid, it is quite recommended not to ignore errors to protect against malicious certificates.

    Update: For a very good explanation why SslProtocol should now be set to tlsv1 instead of the default sslv3, please take a look at the excellent cross link provided below by @Artjom B.

提交回复
热议问题