jsoup を使用して、各タグの後にテキストを抽出したいと考えています。それを直接選択する方法はありますか、または全体で .substring を実行する必要がありますか?
<div>
<a href="#"> I don't want this text </a> 
**I want to retrieve this text**
</div>
    public static void main(String... args) throws IOException {
    Document document = Jsoup.parse("<div>"
            + "<a href=\"#\"> I don't want this text </a>"
            + "**I want to retrieve this text**" + "</div>");
    Element a = document.select("a").first();
    Node node = a.nextSibling();
    System.out.println(node.toString());
}
出力
**I want to retrieve this text**
    はい、できます。
<div>最初にの html を取得し、次にその html を使用して選択します.html()<a>し、その html を取得します<a>要素の htmlの長さを取得する   Document doc = Jsoup.parse("<div>"
            + "<a href=\"#\"> I don't want this text </a>"
            + "**I want to retrieve this text**" + "</div>"); 
   Elements tags = doc.getElementsByTag("a");
   for(Element tag : tags) {
      System.out.println(tag.text());
   }