Created
January 12, 2021 15:21
-
-
Save saasindustries/48e62f45ce24f0141840ac686dd081ff 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
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