PhantomJS failing to open HTTPS site

后端 未结 12 1979
梦如初夏
梦如初夏 2020-11-22 07:53

I\'m using the following code based on loadspeed.js example to open up a https:// site which requires http server authentication as well.

var page = require(         


        
12条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 08:16

    The problem is most likely due to SSL certificate errors. If you start phantomjs with the --ignore-ssl-errors=yes option, it should proceed to load the page as it would if there were no SSL errors:

    phantomjs --ignore-ssl-errors=yes [phantomOptions] script.js [scriptOptions]
    

    I've seen a few websites having problems with incorrectly implementing their SSL certificates or they've expired, etc. A complete list of command line options for phantomjs is available here: http://phantomjs.org/api/command-line.html. I hope this helps.

提交回复
热议问题