maan-htmlparser
v0.1.49
Published
Parse HTML easily
Downloads
16
Maintainers
Readme
maan-htmlparser
A small library that parse HTML using either HTML content or URL !!
Installation
npm install maan-htmlparser
Usage
# If input is HTML content -
var htmlparser = require('maan-htmlparser');
var parsedHTML = htmlparser('<h2 class="title">Hello world</h2>', 'h2');
console.log(parsedHTML);
Output should be ['Hello world']
# If input is URL -
var htmlparser = require('maan-htmlparser');
htmlparser('https://www.google.com/', 'li').then(function(parsedHTML) {
console.log(parsedHTML);
})
Output should be ["Search","Images","Maps","Play","YouTube","News","Gmail","Drive","MoreCalendarTranslateBooksBloggerPhotosDocsEven more »","Calendar","Translate","Books","Blogger","Photos","Docs","","Even more »","Sign in","","Search settingsWeb History","Search settings","","Web History"]
Tests
npm test