HTML parser that works both in JavaScript and NodeJS with TypeScript support
npm install isomorphic-htmlparser



HTML parser that works both in JavaScript and NodeJS with TypeScript support.
Missing something? Create feature request!
Read Documentation 📘
Check Demo 🎁


``bash`NPM
npm install isomorphic-htmlparserYarn
yarn add isomorphic-htmlparser
Import what you need:
`typescript
import { parseHTML } from 'isomorphic-htmlparser'
const el = parseHTML(html).find('.my-class > a.title')
const text = parseHTML(html).extract('.my-class > a.title @ text | trim')
console.log(el.text.trim() === text)
// true
`
> Always import only what is necessary to take full advantage of tree shaking.
Include script from CDN and use isomorphicHtmlparser global variable:
`html``