var casper = require('casper').create();
var utils = require('utils');

// casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36');
  console.log('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.url + ')');
  console.log('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString);
});

casper.start('http://www.apple.com/');

casper.wait(3000, function() {
  var title = casper.getTitle();
  console.log('>>> PageTitle: ' + title);
  console.log('>>> PageHTML:\n' + casper.getHTML());
});

casper.run(function() {
  this.exit(0);
});

var x = require('casper').selectXPath;

casper.on("resource.error", function(resourceError) {