You can use the jsdom npm package:
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const querySelector = "#outOfStock";
const dom = new JSDOM(html);
dom.window.document.querySelector(querySelector) // an HTML node or null
References:
You can use the jsdom npm package:
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const querySelector = "#outOfStock";
const dom = new JSDOM(html);
dom.window.document.querySelector(querySelector) // an HTML node or null
References: