Skip to content

Instantly share code, notes, and snippets.

@rufuspollock
Created October 20, 2012 12:06
Show Gist options
  • Save rufuspollock/3923130 to your computer and use it in GitHub Desktop.
Save rufuspollock/3923130 to your computer and use it in GitHub Desktop.
Police.uk data scraping
var jsdom = require('jsdom');
var fs = require('fs');
// var jquery = fs.readFileSync("./jquery-1.7.1.min.js").toString();
var linklist = 'http://police.uk/data';
jsdom.env({
html: linklist,
scripts: [
'http://code.jquery.com/jquery.js'
],
done: function(errors, window) {
var $ = window.$;
$('#downloads .months table tr td:nth-child(2) a').each(function(idx, elem) {
console.log( $(elem).attr('href') );
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment