Skip to content

Instantly share code, notes, and snippets.

@Je55eah
Je55eah / sitecrawler.js
Last active June 7, 2017 21:40
Website Crawler using PhantomJS
var targetAddress = 'http://www.autohotkey.com/board/';
var fileCount = 0;
phantom.onError = function(msg, trace) {
var msgStack = ['PHANTOM ERROR: ' + msg];
if (trace && trace.length) {
msgStack.push('TRACE:');
trace.forEach(function(t) {
msgStack.push(' -> ' + (t.file || t.sourceURL) + ': ' + t.line + (t.function ? ' (in function ' + t.function +')' : ''));
});