1.0.0 • Published 10 months ago

muninn v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 months ago

Muninn

npm Build Status License

Muninn is a fast and flexible HTML parsing tool that simplifies the process of extracting data from HTMLs. It allows you to create a configuration file, making it easy to keep parser settings up to date even when selectors change. With its easy-to-learn syntax and the power of the cheerio library for parsing, Muninn is a versatile solution for various parsing needs.

Features

  • Fast and efficient HTML parsing
  • Easy-to-learn syntax for creating parser configurations
  • Flexibility to handle changing selectors
  • Powered by the popular cheerio library

Documentation - Changelog

Sample

import { parse } from 'muninn';

const config = {
  schema: {
    title: '#productTitle',
    price: '#priceblock_ourprice',
    rating: {
      selector: '#acrPopover span | float',
      regex: /\d+\.?\d?/
    },
    features: {
      selector: '#productOverview_feature_div tr.a-spacing-small | array',
      schema: {
        name: 'td:nth-child(1)',
        value: 'td:nth-child(2)'
      }
    }
  }
};

// The `data` is an HTML Content of type string.
// https://www.amazon.com/AMD-Ryzen-3700X-16-Thread-Processor/dp/B07SXMZLPK/
const data = '<html>...</html>';

const result = parse(data, config);

Output

{
  "title": "AMD Ryzen 7 3700X 8-Core, 16-Thread Unlocked Desktop Processor with Wraith Prism LED Cooler",
  "price": "$308.99",
  "rating": 4.9,
  "features": [
    {
      "name": "Brand",
      "value": "AMD"
    },
    {
      "name": "CPU Model",
      "value": "AMD Ryzen 7"
    },
    {
      "name": "CPU Speed",
      "value": "4.4 GHz"
    },
    {
      "name": "CPU Socket",
      "value": "Socket AM4"
    },
    {
      "name": "Processor Count",
      "value": "8"
    }
  ]
}

License

Distributed under the MIT License. See LICENSE for more information.

1.0.0

10 months ago

0.27.0

10 months ago

0.25.0

10 months ago

0.26.0

10 months ago

0.24.0

10 months ago

0.23.0

2 years ago

0.22.0

2 years ago

0.21.2

2 years ago

0.21.0

2 years ago

0.20.0

2 years ago

0.19.0

2 years ago

0.18.0

2 years ago

0.15.0

3 years ago

0.17.0

3 years ago

0.16.0

3 years ago

0.14.0

3 years ago

0.11.0

4 years ago

0.13.0

3 years ago

0.9.0

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.5.3

4 years ago

0.9.1

4 years ago

0.7.0

4 years ago

0.5.2

4 years ago

0.10.1

4 years ago

0.12.0

4 years ago

0.12.2

4 years ago

0.12.3

4 years ago

0.12.4

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.5.1

4 years ago

0.4.1

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.11

4 years ago

0.2.10

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.2.6

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.1.10

5 years ago

0.1.11

5 years ago

0.1.12

5 years ago

0.1.13

5 years ago

0.1.14

5 years ago

0.1.15

5 years ago

0.1.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.9

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.0.2

12 years ago

0.0.1

12 years ago