Created
December 28, 2015 02:21
-
-
Save ccjeng/c091221517ae8b6923ad to your computer and use it in GitHub Desktop.
Android Jsoup sample
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
String html = "<div> | |
An <a href='http://example.com/'><b>example</b></a> link.</div> | |
"; | |
Document doc = Jsoup.parse(html); | |
Element link = doc.select("div > a").text(); //example | |
Element link = doc.select("div > a").html(); //<b>example</b> | |
Element link = doc.select("div > a").get(0).text(); //get first link | |
Element link = doc.select("div").text(); //example link. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment