Added error handling to all phantomjs scripts. Exceptions are thrown when certain html elements are missing. The exception is caught, the error is output to stderr and the process exits with error code 1.