Phantomjs 无法使用casperjs单击提交按钮
我正在用casperjs填写一个表单,并在提交时陷入困境。下面是我的代码片段:Phantomjs 无法使用casperjs单击提交按钮,phantomjs,casperjs,Phantomjs,Casperjs,我正在用casperjs填写一个表单,并在提交时陷入困境。下面是我的代码片段: this.then(function(){ this.waitUntilVisible('#ajaxSignin', function(){ this.capture("snapss.png"); this.fill('form#ajaxSignin', { 'j_username' : 'te
this.then(function(){
this.waitUntilVisible('#ajaxSignin', function(){
this.capture("snapss.png");
this.fill('form#ajaxSignin', {
'j_username' : 'testings123testings@gmail.com',
'j_password' : '1234rewq'
}, true);
});
});
this.thenClick('#signin_submit');
this.then(function(){
this.wait(10000, function(){
this.capture('sn8.png');
});
});
在图像“sn8.png”中,我得到了这样的信息:“HTTP状态405-请求方法POST不受支持”。
因此,我推断单击submit按钮有问题。在填写表单之前,脚本工作正常。(站点链接:“”)
您在点击#登录提交按钮之前提交表单
this.waitUntilVisible('#ajaxSignin', function(){
this.capture("snapss.png");
this.fill('form#ajaxSignin', {
'j_username' : 'testings123testings@gmail.com',
'j_password' : '1234rewq'
}, true); // change this to false true will sumbit the
// form right after the input was set