Skip to content

Instantly share code, notes, and snippets.

@konk3r
Created March 13, 2016 04:46
Show Gist options
  • Save konk3r/4473416c665dd531d4f1 to your computer and use it in GitHub Desktop.
Save konk3r/4473416c665dd531d4f1 to your computer and use it in GitHub Desktop.
private void pullRows() {
Elements elements = html.getElementsByTag(ROW_TAG);
ArrayList<ArrayList<String>> rows = new ArrayList<>();
elements.remove();
for (Element element: elements) {
ArrayList<String> row = parseRow(element, CELL_TAG);
rows.add(row);
}
table.setRows(rows);
}
private ArrayList<String> parseRow(Element unparsedRow, String cellTag) {
ArrayList<String> row = new ArrayList<>();
Elements cells = unparsedRow.getElementsByTag(cellTag);
for (Element element: cells) {
row.add(element.text());
}
return row;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment