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

440
Vistas
select only and element on a list of xpaths

$x("//div[@class='card-info__container']/div[3]/a") using this I've found the container, but now I can't get the specific element I need.

when I enter this the response is:

⯆(3) [a.cta.btn, a.cta.btn, a.cta.btn]
  ⯈0: a.cta.btn
  ⯈1: a.cta.btn
  ⯈2: a.cta.btn

how can I take only the first one?

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

0

You can use the at() method to select the first item from the array of a that is returned from executing the XPath:

$x("//div[@class='card-info__container']/div[3]/a").at(0)
over 4 years ago · Santiago Trujillo Denunciar

0

For an XPath that returns a list of elements,

xpath

you can select only the first element via indexing:

(xpath)[1]
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