1.3.0 • Published 10 years ago
scuff v1.3.0
Scuff
One stop shop for web scraping with node. A lightweight wrapper for phantom, request, and cheerio.
Functions
static(url, callback, options)
Uses request to get an HTML body of static webpage. Returns a cheerio function, $, that has jQuery like functionality in node (see cheerio's documentation).
Arguments
url- URL of the page you'd like to scrape.callback- Function with argumentserrorand a cheerio function (jQuery implementation in node) to easily navigate through the HTML or XML structure.options-options.retriesallows you to set the number of attempts to get the requested data's HTML content. Utilizes exponential backoff to reduce and eliminate the number of network errors. Options.retries accepts anumberbetween 1 and 5. Also accepts an objectoptions.cheeriowhich will take any options accepted by htmlparser2
dynamic(url, callback, options)
Uses phantom to get HTML body of a dynamic site (includes dynamic content rendered by JavaScript). Returns a cheerio function, $, that has jQuery like functionality in node (see cheerio's documentation).
Arguments
url- URL of the page you'd like to scrape.callback- Function with argumentserrorand a cheerio function (jQuery implementation in node) to easily navigate through the HTML or XML structure. Includes dynamic content rendered by JavaScript.options-options.retriesallows you to set the number of attempts to get the requested data's HTML content. Utilizes exponential backoff to reduce and eliminate the number of network errors. Options.retries accepts anumberbetween 1 and 5.
