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

179
Vistas
How to retrieve all elements between two nodes with a given class name in XPATH

I extracted this code from tradingview, I want to get access to all the div elements using xpath between this two elements namely C1 indicator and C2 indicator: enter image description here

I tried the following but does not seems working. Any thoughts?

*[following-sibling::div[contains(@data-section-name,'C1 Indicator')] and preceding-sibling::div[contains(@data-section-name,'C2 Indicator')]
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think the point you missed here is that div elements containing the data-section-name attribute are not siblings, they are each inside another parent div elements with titleWrap class name. So, I guess you should search for siblings of those titleWrap divs, while these parent divs should be located by their child divs containing data-section-name attributes. Something like the following:

*[following-sibling::div[contains(@class,'titleWrap') and .//div[contains(@data-section-name,'C1 Indicator')]] and preceding-sibling::div[contains(@class,'titleWrap') and .//div[contains(@data-section-name,'C2 Indicator')]]

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