jscrape = jsdom + request + jquery for the truly lazy
Install
npm install jscrape
Be lazy
Use the same way you'd use request,
passing a url or request-options as the first param,
and a function(err, $, response, body)
callback,
where $
is the jQuery object for the parsed page:
var jscrape = ;
Or just use a function(err, $)
-style callback:
var jscrape = ; { { return Number String str }}
When passing an object as the first param it's passed through directly to request. Instead, when passing in just a url string, its wrapped in a request options object that has some sensible defaults for a simple scraping setup, so you can be lazy. Enjoy!
Workaround for npm trouble with contextify on windows
If you can't npm install jscrape
on windows
because of contextify failing to build,
clone the contextify
repo under
your_project/node_modules/contextify
and replace the contents of lib/contextify.js
with the following:
module { obj { return obj; }};
Now npm install jscrape
in your project folder should work just fine.