How do I create a file in the file system and place the contents of this.getPageContent() inside it?
You could also append to a text file using the method below
var casper = require('casper').create();
var fs = require('fs');
var fname = new Date().getTime() + '.txt';
var save = fs.pathJoin(fs.workingDirectory, 'nwaomachux', fname);
casper.start('http://www.po3w.com/', function() {
fs.write(save, this.getTitle() + '\n', 'w');
});
casper.thenOpen('http://phantomjs.org', function() {
fs.write(save, this.getTitle(), 'a');
});
casper.run();
./phantom casperjs/bin/bootstrap.js --casper-path=casperjs --cli save.js