I am using Jsoup library to parse html in my android app.This is the column in the html page which i want to parse:
<TD width="9%" ROWSPAN = 2>Days</TD>
Now i want to get all the rows of this column.I am using following code do achieve my goal but the success is far away:
StringBuilder s = new StringBuilder(100);
Document doc = Jsoup.parse(htmlPage);
Elements links = doc.select("table tr.Day");
for (Element link : links)
{
String linkHref = link.attr("href");
System.out.println(linkHref);
s.append(linkHref);
String linkText = link.text();
System.out.println(linkText);
s.append(linkText);
}
I searched a lot but of no avail.Please help me.Thanks in advance.
Assuming your html looks similar to this:
if I understand aright you want everything below the
tdtag with days.Using the html posted before you get this output: