In a Java application, imagine I have this somewhere in a huge HTML code:
<h2>
<b>
This
</b>
</h2>
<h1>
</h1>
So imagine I want to get the first element h1
after the element b
. I've tried some CSS selectors through the JSoup library but found nothing useful. The greatest problem here is: They are not siblings. I don't know if the b
element is or is not a child of a different parent.
Is there a way of doing it?