Getting something useable from https://angular.io/start

10 views
Skip to first unread message

Philipp Richter

unread,
Aug 24, 2019, 1:50:12 PM8/24/19
to jsdom
Hello,


I was wondering while using jsdom and testing on https://angular.io/start what I would need to do to get a usable result ?
I'm not sure what is happening but what is certain is that I am unable to retrieve the text I would see on the page using a browser.

Code snippet :


const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const virtualConsole = new jsdom.VirtualConsole();
virtualConsole
.sendTo(console);

JSDOM
.fromURL("https://angular.io/start", {
 runScripts
: "dangerously",
 resources
: "usable",
 virtualConsole
}).then(dom => {
 setTimeout
(() => console.log(dom.serialize()), 4000);
});



Best Regards,
Philipp Richter
Reply all
Reply to author
Forward
0 new messages