Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda