Created
March 13, 2016 04:46
-
-
Save konk3r/603028d9ba00761c6bc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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