我正在使用此代码登录窗体。我得到错误。casperjs登录表单错误
var casper = require('casper').create();
var url = "www.example.com";
casper.start(url,function(){
this.echo(this.getTitle());
});
casper.waitForResource(url,function() {
this.fillSelectors("form[method='post']", {
'input[name="userName"]' : 'usr1',
'input[name="password"]': 'pswed1'
}, true);
});
casper.run();
我几乎复制的例子,我在栈上找到,但我仍然得到错误...怎样做才能解决这个问题?
它告诉你它找不到形式... – mfreitas
我得到了,但我试过一遍又一遍......没有理由...... – macroscripts
你确定你是正确的网页上?你有截图检查('casper.capture()')?请注册到'resource.error','page.error','remote.message'和'casper.page.onResourceTimeout'事件([Example](https://gist.github.com/artjomb/4cf43d16ce50d8674fdf)) 。也许有错误。 –