Html parsing with JSoup

后端 未结 5 1013
天涯浪人
天涯浪人 2021-01-01 08:17

I am trying to parse the html of the following URL:

http://ocw.mit.edu/courses/aeronautics-and-astronautics/16-050-thermal-energy-fall-2002/

to obtain the te

5条回答
  •  庸人自扰
    2021-01-01 08:37

    Here is a code

    Document document = Jsoup.connect("http://ocw.mit.edu/courses/aeronautics-and-astronautics/16-050-thermal-energy-fall-2002/").get();
    
            Elements elements = document.select("p");
            System.out.println(elements.html());
    

    You can select all tags using Selector property of Jsoup. It will return the text and tags of

    .

提交回复
热议问题