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

290
Vistas
JS Cheerio scraping dont work in node, but work fine in console on website

I am scraping some data from a webiste using cheerio. I get the output I want in the console, but not in my node.

I am scraping the price on this website: https://www.coindesk.com/price/bitcoin-sv/

In the console, this is working: $('div[class="sc-bxivhb cNnmSt"] span[class="Typography__StyledTypography-sc-1xaoczh-0 euSZAS"]').textContent

When I run it in the node I write: $('div[class="sc-bxivhb cNnmSt"] span[class="Typography__StyledTypography-sc-1xaoczh-0 euSZAS"]').text() but its not working.

Anyone know why?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The page you are trying to scrape is generated with JavaScript. If you look into view-source:https://www.coindesk.com/price/bitcoin-sv/ you will look mostly JavaScript and not so much HTML. cheerio cannot run JavaScript, it just parses static source code.

You need something like https://github.com/puppeteer/puppeteer to get JS-generated content.

about 4 years ago · Juan Pablo Isaza Denunciar
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