Skip to content

Instantly share code, notes, and snippets.

@aaroneiche
Created March 31, 2017 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaroneiche/84d8a77cac8531d1c4f426bd5a6fef5e to your computer and use it in GitHub Desktop.
Save aaroneiche/84d8a77cac8531d1c4f426bd5a6fef5e to your computer and use it in GitHub Desktop.
A simple node script for parsing a Police Dispatch webpage.
'use strict'
var $ = require('cheerio')
var request = require('request')
function gotHTML(err, resp, html) {
if (err) return console.error(err)
var parsedHTML = $.load(html)
parsedHTML("tr td").map(function(i,td){
console.log($(td).text());
});
}
var domain = 'http://coeapps.eugene-or.gov/SPDDispatchLog/'
request(domain, gotHTML)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment