I want to get the text inside the element that comes after a certain text ie. 'Projected earning growth'. I want to get the value 18.10% . The pattern I want to follow is lookup for a certain text as above, and then get the text following the immediate h2 element.
Is it possible to have one xpath expression that will do both the steps together?
- Match the div for a certain text 'Projected earning growth'
- Go to the immediate h1 element outside the div (I have to jump two divs here to get to the h1 element)
How do I match for a text and get to the next immediate h1 element via xpath?
<div>
<div class="p small mb-8 box-label text-left text-blue-500">
<div class="tt-container">
<button aria-label="open tooltip" class="button link" type="button" role="tooltip" aria-expanded="false">
Projected earning growth
</button>
</div>
</div>
<h2 class="mb-8 text-left">18.10%</h2>
</div>