I use CasperJS to evaluate a webpage. What I would like to do is let me pass the argument, which is the URL, load CasperJS and evaluate the page and put it on a standard website so that I can use it in a BaSH script. Here is my code so far for Casper:
var casper = require('casper').create();
var url = casper.cli.args;
casper.start(url, function() {
this.evaluate(function() {
return document;
});
this.echo(this.getHTML());
});
casper.run();
This is what I see when I run it:
@:~/spider/casperjs$ casperjs viewsource.js google.com
CasperError: No steps defined, aborting
/usr/local/src/casperjs/modules/casper.js:1510 in run
~/spider/casperjs/viewsource.js:10
Help me please.
source
share