Skip to content

Instantly share code, notes, and snippets.

@saasindustries
Created January 12, 2021 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saasindustries/48e62f45ce24f0141840ac686dd081ff to your computer and use it in GitHub Desktop.
Save saasindustries/48e62f45ce24f0141840ac686dd081ff to your computer and use it in GitHub Desktop.
ArrayList<String> hyperLinks = new ArrayList<String>();
// iterating and extracting
for (Element e:pageElements) {
hyperLinks.add("Text: " + e.text());
hyperLinks.add("Link: " + e.attr("href"));
}
for (String s : hyperLinks) {
System.out.println(s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment