Username and password can be filled, but "Sign in" button can't be clicked.
Here is my command line:
/usr/local/bin/casperjs /Users/twyt/Downloads/casperLogin.js http://bato.to/
And here is casperLogin.js:
var casper = require('casper').create({
pageSettings: {
loadImages: true, // The WebPage instance used by Casper will
loadPlugins: true,
userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7" // use these settings
},
logLevel: "info", // Only "info" level messages will be logged
verbose: true // log messages will be printed out to the console
});
casper.start(casper.cli.get(0), function() {
});
casper.then(function() {
this.click('a[id="sign_in"]');
this.echo("sign_in click");
});
casper.wait(3000, function () {
this.sendKeys('div.ipbfs_login div.ipbfs_login_col input[id="ips_username"]', 'york');
this.sendKeys('div.ipbfs_login div.ipbfs_login_col input[id="ips_password"]', "szWYB213456");
this.echo("fill user name");
});
casper.then(function() {
this.click('div.ipbfs_login div.ipsForm_submit.ipsForm_center.clear input[type="submit"]');
this.echo("click sign_in button");
});
casper.wait(5000, function () {
this.echo(this.getTitle());
this.capture("login.png");
});
casper.run();