Html parser using Jsoup -
I want to remove a lecture area in the div tag, though I tried to get the lecture room using div ( Lectureinfo room) but it brings me the other stuff in the table. Can somebody help me out? This is the source code.
& lt; Tr class = "odd" & gt; & Lt; Th & gt; 9: 00 & lt; / Th & gt; & Lt; TD & gt; & Lt; Div class = slot data-hour = "9" data-day = "0" data-day-month = "9" data-month name = "June" data-month = "6" data-year = "2014" > Gt; & Lt; Span class = target & gt; & Lt; / Span & gt; & Lt; Div rel = tipsy title = "lecture" class = "lecture" data lecture-pk = "21044" & gt; & Lt; Strong> CS-M71 & lt; / Strong> & Lt; Period & gt; From CJW & lt; / Span & gt; & Lt; Div class = "lectureinfo room" & gt; Faraday 205 Robert Records & lt; / Div & gt; & Lt; Div class = "lectureinfo week" & gt; Week: 15-16, 18-25 & lt; / Div & gt; & Lt; / Div & gt; First, there are a lot of questions on the stack overflow and on the Internet where it describes how has been done. The best source will definitely still be the jasps documentation, and especially.
Multiple sections, such as & lt; Div class = "lectureinfo room" & gt; to give you a . Classmates must be separated with , such as document doc = jsoup.parse (html); Element lecturerum = doc.select ("div.lectureinfo.room"). first (); Println (lectureRoom.text ()); The output will be
Faraday 205 Robert Records Make sure to look through the book as much as possible!
Comments
Post a Comment