Output into file

(function() {
  fs = require("fs");
  path = 'file.txt';

  casper = require('casper').create({});

  casper.start(URL, function() {
    fs.write(path, object, 'a');
    fs.write(path, "\n", 'a');
  });
  casper.run(function() {
    this.echo(Date.now()-start + "ms");
    this.echo("Finished running ...");
    return this.exit();
  });
}).call(this);

你可能感兴趣的:(Output into file)