I have been trying to create a login script to check my bing rewards points with CasperJS, I’m looking at the debug output and everything looks fine except that it doesn’t successfully login. (So the rewards on my account doesn’t show). I have tested this in the chrome console and avoided using casper.fill because that refreshes the login page instead. The login info is a working test account.
var system = require('system');
var utils = require('utils');
var casper = require('casper').create({
verbose: true,
logLevel: 'debug'
});
var binglink = "https://login.live.com/ppsecure/post.srf?wa=wsignin1.0&rpsnv=11&ct=1347289667&rver=6.0.5286.0&wp=MBI&wreply=https:%2F%2Fssl.bing.com%2Fsecure%2FPassport.aspx%3Frequrl%3Dhttps%253a%252f%252fssl.bing.com%252faccount%252frewards%253fru%253dhttp%25253a%25252f%25252fwww.bing.com%25252f&lc=1033&id=264960&bk=1347289670";
casper.start(binglink, function() {
casper.evaluate(function() {
document.querySelector('input[type="email"]').value = "genericemail@live.com";
document.querySelector('input[type="password"]').value = "genericpassword";
document.querySelector('input[type="submit"]').click();
});
});
casper.then( function(){
this.wait(2000);
})
casper.then( function(){
this.echo("Capturing Page");
this.capture('bing.live.png');
});
casper.run();
I had been working on something similar and this is how I was managed logging into their site.