Jsoup - extracting text

后端 未结 4 1906
日久生厌
日久生厌 2020-12-18 01:10

I need to extract text from a node like this:

Some text with tags might go here.

Also there are paragraphs<

4条回答
  •  春和景丽
    2020-12-18 01:28

    you can use TextNode for this purpose:

    List bodyTextNode = doc.getElementById("content").textNodes();
        String html = "";
        for(TextNode txNode:bodyTextNode){
            html+=txNode.text();
        }
    

提交回复
热议问题