Learning CasperJS
Попытка понять, почему следующее не отображает мои результаты в консоли ....
Выход:
casperjs testcasper.js
[info] [phantom] Начало ...
[info] [phantom] Беговой комплект: 3 шага
код:
var casper = require('casper').create({
loadImages: true,
loadPlugins: true,
verbose: true,
logLevel: 'debug',
});
casper.start(url, function() {
this.debugPage();
this.echo("Test echo.");
this.fill('form#LogonForm', {
'username': username,
'password': password,
}, true);
});
casper.then(function() {
casper.echo("I'm loaded.");
});
casper.run(function() {
console.log(this.getCurrentUrl(),'info');
});
//casper.log('this is a debug message', 'debug');
//casper.log('and an informative one', 'info');
//casper.log('and a warning', 'warning');
//casper.log('and an error', 'error');
casper.exit();