html-extract

HTML data extraction

npm install html-extract
2 downloads in the last week
4 downloads in the last month

html-extract

HTML data extraction

Installation

npm install html-extract

Quick Start

var extract = require('html-extract');

var data = extract("<html>...</html>", {
  title: function ($) {
    return $('#title').text().trim();
  },

  description: function ($) {
    return $('.description').text().trim();
  },

  tags: function ($) {
    var tags = [];

    $('#tags > a').each(function (index, item) {
      tags.push($(item).text().trim());
    });

    return tags;
  }
});

API

License

MIT

npm loves you