1.0.0 • Published 5 years ago
kingparsing v1.0.0
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
1.0.0
5 years ago