Skip to content

Instantly share code, notes, and snippets.

@creationix
creationix / scraper.js
Created August 23, 2010 05:12
Simple scraper tool
var http = require('http'),
Url = require('url'),
htmlparser = require('node-htmlparser'),
dom = require('jsdom/level1/core').dom.level1.core,
index = require('jsdom/browser/index'),
sizzleInit = require('sizzle').sizzleInit;
// Simple wrapper around node's http client, htmlparser, jsdom, and sizzle
function fetch(url, callback) {
var uri = Url.parse(url);