You don't want to use doc.getElementById("td")
because <td>
is not id
attribute, but tag (also getElementById
doesn't support CSS query).
What you want is to select
first <td>
with class levels
. You can do it via
Element tag = doc.select("td.levels").first();
Also to get only text which will be generated with this tag (and not entire HTML) use text()
method like
System.out.println(tag.text());