Skip to content

Instantly share code, notes, and snippets.

@JmzTaylor
Created August 15, 2017 20:41
Show Gist options
  • Save JmzTaylor/5a08a157707edd584652d0825be331f9 to your computer and use it in GitHub Desktop.
Save JmzTaylor/5a08a157707edd584652d0825be331f9 to your computer and use it in GitHub Desktop.
Given this HTML
<div class="team-moree">
<h2>Some heading</h2>
Bats: Right
Throws: Right
Position: OF
&nbsp;
</div>
and using this code to read it
Elements descs2 = doc.getElementsByClass("team-moree");
for (Element names : descs2) {
name = names.select("h2").first().ownText();
bio = names.text().replace(name, "");
}
How would I preserve the line breaks in the text?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment