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

599
Vistas
TimeoutError: waiting for selector '--selector--' failed: timeout 30000ms exceeded

If I run code without 'waitForSelector' it gives 'null' and when I run it with 'waitForSelector' it gives time exceeded error. I already have tried giving custom value for timeout but still the problem persist.

error: Timeout or other error: TimeoutError: waiting for selector [class*="header-content"] span:nth-child(2) failed: timeout 30000ms exceeded

Output needed: '1 views'

Code:


const viewsData = async () => {   
  const browser = await puppeteer.launch()   
  const page = await browser.newPage()    
  await page.goto("https://www.loom.com/share/5b920dc1375f43fa9b622ac0a6ba7c52")   
  await page    
    .waitForSelector(`[class*="header-content"] span:nth-child(2)`)   
    .then(() => {  
      console.log("Success")   
    })   
    .catch((err) => {    
      console.log("Timeout or other error: ", err)   
    })    
  let re = await page.evaluate(() => document.querySelector(`[class*="header-content"] span:nth-child(2)`))   
  console.log(re)    
  await browser.close()   
}    
viewsData()

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