Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!