Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
Cheerio with mhtml to parse styles

So I am trying find elements on a DOM that are hidden via CSS, for example this is how I am finding them with puppeteer

let hiddenSelectors = [];
    const all = document.getElementsByTagName("*");
    let style;
    for (var i = 0, max = all.length; i < max; i++) {
      style = window.getComputedStyle(all[i]);
      if (
        style.width == "0" ||
        style.height == "0" ||
        style.opacity == "0" ||
        style.display == "none" ||
        style.visibility == "hidden"
      ) {
        hiddenSelectors.push(all[i]);
      }
    }

I want to then mark these elements with an html tag (e.g. hidden=true), however, I don't want to change the rendered dom itself... so I can't use puppeteer.

My idea was to extract a page's MHTML with all the applied css and see if I can then take this similar approach with cheerio.

Does anyone know if/how to use MHTML with cheerio to search for these types of styles?

So basically I want to use puppeteer or mhtml to find elements that css hides, then mark that selector or parent selector on the html. So when processing that html we know what is hidden upon rendering.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!