(a simple example)
NODE
<div id="product"> <img id="img" src="box.png"> <div id="name">Empty Box</div> <div id="price">$12.34</div> <input type="button" value="Add To Cart"> </div>
LOAD JSDOM const jsdom = require("jsdom"); const { JSDOM } = jsdom;
FETCH HTML & EXTRACT DATA fetch("http://site.com/dummy.html") .then(res => res.text()).then(txt => { const dom = new JSDOM(txt); const doc = dom.window.document; var img = doc.getElementById ("img").src; var name = doc.getElementById ("name").innerHTML; var price = doc.getElementById ("price").innerHTML; });