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

218
Vistas
Unable to get image src url with Cheerio

At the moment I am trying to get value in src= of

<div class="page-break no-gaps">
  <img id="image-0" src="https://foo.bar/image.jpg" class="wp-image" alt="Title">
</div>

with the following code:

getImageSrc(imageObj: Cheerio | undefined): string {
    let image
    image = imageObj?.attr('src')
    console.log(image)
}

selector code: chapterDetailsSelector = 'div.page-break > img'

However all I am getting is undefined

EDITED - add more context

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

0

View source html != what is fetched by cheerio

Seems like the image url is in attr('data-cfsrc') rather than attr('data') when fetched with cheerio

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