Assuming I have found an element using:
Element link = div.select("a:not([class])").first();
I now want to find out whether this particular element is enclosed within a <span class="uniqspan"> — not necessarily a direct descendant.
Is there a way to do that in Jsoup?
Update: I just found the wonderful Element.parent(). I am going to check whether this can be a start…
That’s not directly possible from the
Element linkon. I’d suggest to collect all links in aspan.uniqspanfirst and then check if it contains thelink.E.g.