Skip to content

Instantly share code, notes, and snippets.

@TyOverby
Created June 22, 2011 23:15
Show Gist options
  • Save TyOverby/1041525 to your computer and use it in GitHub Desktop.
Save TyOverby/1041525 to your computer and use it in GitHub Desktop.
Gets all of the elements in an html table
Url input = new Url("http://what.cd/forums.php?action=viewforum&forumid=7");
Document doc = Jsoup.parse(input,500);//500 is the timeout
Elements rowsa = content.getElementsByClass("rowa");
Elements rowsb = content.getElementsByClass("rowb");
Elements totalRows = rowsa+rowsb //don't know what to do here, but concatinate them if possible
for (Element row : totalRows) {
for(Element data : row.children()){
System.out.println(data.text());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment