I am trying to use jsdom to parse some html content. The examples I saw use the .createWindow () method of a jsdom.jsdom document based on html content.
But when I try to follow these examples, my document does not have a .createWindow () method.
var getaPage=function (req, res, callback) {
jsdom.defaultDocumentFeatures={
FetchExternalResources : ['script'],
ProcessExternalResources : ['script'],
MutationEvents : '2.0',
QuerySelector : false
};
var htmlDoc = '<html lang="en-US">' +
'</html>';
var tstDocument=jsdom.jsdom(htmlDoc);
for (var attr in tstDocument){
if (attr == 'createWindow') {
console.log('Found it');
}else{
console.log('not it');
};
};
};
When I run this, I get a bunch of no and found.
Why don't I have a .createWindow () method?
source
share