casperjs无法打开https网址

时间:2014-11-24 09:52:10

标签: javascript phantomjs casperjs

在Windows 7上运行测试

在casperjs中,我尝试打开 https 页面,如下所示:

...
var Link1 = 'https://mylink1.com/';
casper.waitForSelector("input#KeyField", function() {
        console.log(Link1);
        this.sendKeys('input#KeyField', Link1 );
    });
casper.then(function() {
        this.echo(this.getTitle());
        this.capture(dir1 + 'image1.png', {
            top: 0, left: 0, width: 2000, height: 1000
            });
        });
...

Casperjs不会打开链接,而是使用" http"对于我本地的同一页面,它只是有效。

然后我尝试了类似的东西:

  • casperjs test mytest1.js --ignore-ssl-errors = true --ssl-protocol = tlsv1
  • casperjs test mytest1.js --web-security = no
  • casperjs test mytest1.js - ssl-protocol = any
  • casperjs test mytest1.js --ignore-ssl-errors = yes
  • casperjs --ignore-ssl-errors test mytest1.js

仍然,casperjs无法打开它。任何想法请。

1 个答案:

答案 0 :(得分:1)

这对我有用:

casperjs test mytest1.js --ignore-ssl-errors=true
相关问题