/web-parser

This is a simple tool to parse websites using the jQuery interface.

Primary LanguageTypeScript

web-parser

This is a simple tool to parse websites using the jQuery interface, see cheerio API.

Simple usage

Print all <p> contents on the page:

const { parse } = require('web-parser');

const [$, $elements] = await parse('http://sample.com', 'p');
$elements.each((index, element) => {
  const $element = $(element);
  console.log(`index: ${index}, text: ${$element.text()}`);
});

Examples

Check examples folder!