Snippet of HTML Code:
<div class="content">
<div id="tab">
<div class="row">
<div class="col-sm-12">
<div>
<div>
<div>
</div>
<div>
<p><span>01</span></p>
<p class="className"><span id="">parent</span>
Child
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
The challenge is to locate "child" within the HTML content, separate from "parent":
//*[@id="tab"]/div/div/div[1]/div[1]/div[2]/p.span
While locating "parent" works fine with the above query, isolating "child" proves challenging. Attempts have been made using various methods without success:
//*[@id="tab"]/div/div/div[1]/div[1]/div[2]/p/text()
//*[@id="tab"]/div/div/div[1]/div[1]/div[2]/p/text()[contains(.,'child')]
Interestingly, these queries yield results in online editors but return an "element absent on the page" error in a Java IDE.
Any insights or recommendations would be greatly appreciated!