JSDom - Get innerhtml and remove all scripts

Viewed 91

I just started looking into JSDom - I want to get a rendered dom as I would see in a browser and this looks like a potential tool.

However, however do I get just the innerHTML? I tried the below, however it didn't render the page fully before returning:

const jsdom = require("jsdom");
const { JSDOM } = jsdom;

JSDOM.fromURL("https://time.is/").then(dom => {
  console.log(dom.window.document.body.innerHTML);
});
0 Answers
Related