Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

kingparsing

1.0.0 • Public • Published

Easy Parsing

Easy HTML wrapper

Install

npm install kingparsing

Import

const parse = require("kingparsing")

Use

Get a sorted list of all html elements

This list is ordered by type of element.
return a JSON Object.

parse("http://www.google.com")
    .then(console.log)
    .catch(console.error)

Get a list of items that contain this attribute

This list contains any type of element.
return an Array

parse.getByAttributes("http://www.google.com",{id:'lga'})
    .then(console.log)
    .catch(console.error)

Get a list of items that contain a specific content

This list contains any type of element.
return an Array

parse.getByContent("http://www.google.com","search")
    .then(console.log)
    .catch(console.error)

Appearances

Here is the appearance that the HTML element objects will have.

{
    "type" : "type of html element",
    "match" : "body of html element",
    "content" : "content of html element",
    "attributes" : {
        "attribute1 name" : "attribute1 value",
        "attribute2 name" : "attribute2 value"
    }
}

Thanks

Install

npm i kingparsing

DownloadsWeekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

6.07 kB

Total Files

4

Last publish

Collaborators

  • avatar