Skip to content

Latest commit

History

History
14 lines (11 loc) Β· 381 Bytes

File metadata and controls

14 lines (11 loc) Β· 381 Bytes

How to parse an HTML page with Node.js

You can use the jsdom npm package:

constjsdom=require("jsdom");const{JSDOM}=jsdom;constquerySelector="#outOfStock";constdom=newJSDOM(html);dom.window.document.querySelector(querySelector)// an HTML node or null

References: