Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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