I am using Power Automate Desktop to get information from a dynamically generated website. The elements go very deep and they don't mostly have usable handles, so I need to use the inner text to navigate around the document.
I am able to get to the static text element with label:contains("static text")
, the hidden one with label:contains("static text") + div
but I can't seem to be able to get to the one I get.
I tried label:contains("static text"):parent() + div
but this returns the hidden static text as well for some reason. Interestingly, getting text from label:contains("static text"):parent():parent()
returns the visible static text and label:contains("static text"):parent():parent():nth-child(2)
cannot be found...
<div>
<div>
<div>
<ul>
<li>
<div>
<label>
STATIC TEXT I CAN FIND
</label>
<div>
HIDDEN STATIC TEXT I DON'T CARE ABOUT
</div>
</div>
<div>
<div 3x>
<li>
<div 3x>
<ul></ul>
<div>
DYNAMIC TEXT I WANT TO EXTRACT
</div>
</div>
</li>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>