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

240
Vistas
How to test result from page.evaluateHandle & el.nextElementSibling?

How do you test that child actually contains the next Element Sibling or if there was NO next sibling found?

child = await page.evaluateHandle(el => el.nextElementSibling, child);

Nothing I've found seems to work. :(

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Finally figured it out.

.nextElementSibling - returns a Node object or null.

.evaluateHandle - returns a jsHandle containing that result.

So you have to process the jsHandle container which holds the result.

jsHandle.asElement() - Returns either null or the object handle itself, if the object handle is an instance of ElementHandle.

You test for a failed result with:

if (child.asElement() === null) {
//do something
}
over 4 years ago · Santiago Trujillo 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