java - Jsoup select text after tag -
i want extract text after each tag using jsoup. there way select directly or have perform .substring on whole thing?
<div> <a href="#"> don't want text </a> **i want retrieve text** </div>
public static void main(string... args) throws ioexception { document document = jsoup.parse("<div>" + "<a href=\"#\"> don't want text </a>" + "**i want retrieve text**" + "</div>"); element = document.select("a").first(); node node = a.nextsibling(); system.out.println(node.tostring()); }
output
**i want retrieve text**