我在桌面上编写的这段代码在Windows 10下运行,一切正常。当我搬到Centos Server时,我开始出错。请帮帮我
var casper = require('casper').create();
casper
.start('https://example.com', function() {
this.echo(this.getTitle());
this.click("span.btn.btn-green");
}).wait(5000).then(function () {
this.capture('sdsdsd.png');
this.sendKeys('input[name="email"]', 'name');
this.sendKeys('input[name="password"]', 'pass');
this.click("button.btn.btn-h40.btn-green.btn-fw.btn-submit");
console.log("Auth");
})
casper.run();
{{1}}
答案 0 :(得分:1)
使用phantomjs选项--ignore-ssl-errors=true
绕过SSL认证验证。有关详细信息https://casperjs.readthedocs.io/en/latest/cli.html#casperjs-native-options