How to extract texts between

tags

前端 未结 3 1985
走了就别回头了
走了就别回头了 2021-01-11 18:18

I want to extract texts from HTML page(s) which placed in p and li tags, so I can start to tokenize the page to construct inverted index(es) for ea

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-11 18:52

    String testText1 = d.select("body").text();
    System.out.println(testText);
    

    or

    String testText2 = d.select("body p").text();
    System.out.println(testText);
    

    You can use this for getting the text from tags.

提交回复
热议问题