Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 430 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 430 Bytes

htmldom2

Parsing html on top of xmldom and htmlparser2

Usage

Parse html from a string

const source = `
<html>
  <head>
    <title>Hello World</title>
  <body>
    <h1>Hello World</h1>
  </body>
</html>
`;
const { DOMParser } = require('htmldom2');
const document = new DOMParser().parseFromString(source, 'text/html');