Page Scraper
Web page scraper with a jQuery-like syntax for Node. Powered by got and cheerio.
Installation
$ npm install page-scraper
Usage
const scrape = ; async { const $ = await ; // Extract the page with jQuery like syntax. console;};
Check the cheerio documentation for a complete guide on how to scrape the page using jQuery like syntax.
Recipes
Handling Error
const scrape = ; async { try const $ = await ; catcherror // The error message. console; if error // The HTTP status code. console; if error // The HTML document. console; };
Note that if the page is not an HTML document, it will throw an error too.
const scrape = ; async { try const $ = await ; catcherror console; if error // The response body. console; };
Scraping Multiple Pages
const scrape = ; async { const $ = await Promiseall ; console;};