html-extract

0.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i html-extract

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • shallker-wang