javascript - Why can't my CasperJS script login to Quora? -


this code:

var casper = require('casper').create({     verbose: true,     loglevel: 'debug' });    casper.start('http://www.quora.com', function()         {                 this.click('input.submit_button');                 this.echo("page loaded");                 this.test.assertexists('form.inline_login_form', 'form found');             this.fill('form.inline_login_form',{email:'xxxxxx@gmail.com',password:'xxxx'},false);          } );  casper.then(function(){         this.click('input.submit_button');  });  casper.then(function(){          this.capture('google.png', {         top: 0,         left: 0,         width:0,         height:0     });    this.echo("page title " + this.gettitle()); });  casper.run(); 

this image capture method produces: enter image description here

why doesn't login? id , password correct.

try this, must work :

var casper = require('casper').create({ viewportsize: {     width: 1080,     height: 768 } });  var email = "xxx@abc.com";  var pass = "********";    casper.start('http://www.quora.com', function()     {             this.click('input.submit_button');             this.echo("page loaded");             this.test.assertexists('form.inline_login_form', 'form found');         this.fill('form#__w2_b3oun76_login_form',{email:'email',password:'pass'},true);      });  casper.waitforselector("form[name=search_form] input[name='search_input']", function(){     this.capture('google.png');    this.echo("page title " + this.gettitle()); });  casper.run(); 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -