Unable to load all Stylesheets from any document

12 views
Skip to first unread message

Praneet Bhave

unread,
Sep 14, 2021, 4:19:33 AM9/14/21
to jsdom
Hi Everyone, 

I'm using the following code. And I'm getting only a fraction of stylesheets from any URL. 

JSDOM.fromURL(url, { resources: 'usable' }).then(pagedom => {

    var styleSheetsCollection = pagedom.window.document.styleSheets;
     console.log(styleSheetsCollection.length);
})

For ex. for google.com I will get 5 styleSheets when the actual number on the page is 37. 

markuphero-UUFPUBXyqbOKhqHluuOR-1.png

Even if I use setTimeout =30s and check back the result is slightly higher ma. But I don't get all the 37 styleSheets.

Can someone point me on in the right direction here on how I can can get all the stylesheets from the page? 

Appreciate the help a lot! 
Praneet
Reply all
Reply to author
Forward
0 new messages