0.0.1 • Published 11 years ago

html-extract v0.0.1

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

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