Unable to load all Stylesheets from any document

Skip to first unread message

Praneet Bhave

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;

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


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! 
Reply all
Reply to author
0 new messages