2013-03-05 17:10:02 +01:00
|
|
|
/*jshint strict:false*/
|
|
|
|
/*global CasperError console phantom require*/
|
|
|
|
|
|
|
|
/**
|
2012-11-08 17:11:43 +01:00
|
|
|
* This script will add a custom HTTP status code handler, here for 404 pages.
|
|
|
|
*/
|
|
|
|
|
|
|
|
var casper = require("casper").create({
|
|
|
|
httpStatusHandlers: {
|
|
|
|
404: function(self, resource) {
|
|
|
|
this.echo("Resource at " + resource.url + " not found (404)", "COMMENT");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
verbose: true
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.start("http://www.google.com/plop", function() {
|
|
|
|
this.echo("Done.");
|
|
|
|
this.exit();
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.run();
|