So this is my script so far.
I also posted the out put below the code for you guys and gals.
When it runs it doesn't stop and never returns the screenshot just hangs with no errors or anything.
var casper = require('casper').create({
verbose: true,
logLevel: 'debug',
pageSettings: {
loadImages: true,
loadPlugins: true,
userAgent: 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0'
}
});
casper.start('https://dilionsmith.me/ghost/#/signin', function() {
this.waitForSelector('form[method="post"]');
});
casper.then(function() {
console.log("page loaded");
this.fill('form[method="post"]', {
identification: 'email',
password: 'pass'
}, true);
});
casper.then(function() {
casper.capture('after.png');
});
casper.run();
Output:
[info] [phantom] Starting...
[info] [phantom] Running suite: 4 steps
[debug] [phantom] opening url: https://dilionsmith.me/ghost/#/signin, HTTP GET
[debug] [phantom] Navigation requested: url=https://dilionsmith.me/ghost/#/signin, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "https://dilionsmith.me/ghost/#/signin"
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step anonymous 2/4 https://dilionsmith.me/ghost/#/signin (HTTP 200)
[info] [phantom] Step anonymous 2/4: done in 578ms.
[info] [phantom] Step _step 3/5 https://dilionsmith.me/ghost/#/signin (HTTP 200)
[info] [phantom] Step _step 3/5: done in 598ms.
[debug] [phantom] Navigation requested: url=https://dilionsmith.me/ghost/#/, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "https://dilionsmith.me/ghost/#/"
[debug] [phantom] url changed to "https://dilionsmith.me/ghost/#/"
The problem is you're not containing input names on '':
casper.then(function() {
console.log("page loaded");
this.fill('form[method="post"]', {
identification: 'email',
password: 'pass'
}, true);
});
should be:
casper.then(function() {
console.log("page loaded");
this.fill('form[method="post"]', {
'identification': 'email',
'password': 'pass'
}, true);
});
Hope it helps.