Skip to content

Instantly share code, notes, and snippets.

View michaelhasan's full-sized avatar

Michael Hasan michaelhasan

  • Transactional Records Access Clearinghouse
  • Syracuse, NY
View GitHub Profile
@michaelhasan
michaelhasan / dontbreakthechain.js
Created December 2, 2015 15:55
Scraping a web site with phantomjs
phantom.onError = function(message, trace) {
console.error('[PHANTOMJS ERROR] ' + message);
trace.forEach(function(t) {
console.error(' >> [' + t.line + '] ' +
(t.function ? '[' + t.function + '] ' : '') +
t.file || t.sourceURL);
});
phantom.exit(1);
};
@michaelhasan
michaelhasan / fptest.js
Last active August 29, 2015 14:21
FOIA Project casperjs test
/**
* First attempt at automatically testing foiaproject.org
*
*/
casper.on('remote.message', function(msg) {
/* this.echo('remote message caught: ' + msg); */
});
casper.options.verbose=false;
casper.options.logLevel="none";
casper.options.viewportSize = {width: 1680, height: 1050 };