Skip to content

Instantly share code, notes, and snippets.

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