url = "https://example.com/";
casper.start(url, function () {
this.echo('url: ' + url);
this.echo('myCloud requested...');
this.echo('Page title: ' + this.getTitle());
});
casper.then(function () {
this.echo('Clicking submit button...');
this.click('input#SubmitButton');
...
当我在普通浏览器中请求portalUrl(“https://example.com/”)时,它会重定向到ADFS登录页面“ADFSloginUrl”,但使用CasperJS它无法访问ADFS的登录页面。
在上面的代码中请求的页面未加载。因此“this.getTitle()”为空,并且无法从 CasperJS 访问提交按钮。
访问提交按钮时出现以下错误:
"Message: CasperError: Cannot dispatch mousedown event on nonexistent selector: input#SubmitButton"
这与casper.start
有什么关系吗?
最佳答案
--ssl-protocol=any 已经为我解决了这个问题。 casperjs --ssl-protocol=any yourcode.js
感谢您的所有回答,它们非常有帮助
关于javascript - CasperJS 的启动在应该有重定向的情况下不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27223088/