final HashSet<String> set = new HashSet<>();
Parser parser = new Parser(html);
NodeList matches = parser.extractAllNodesThatMatch(LINK_FILTER);
SimpleNodeIterator it = matches.elements();
while (it.hasMoreNodes()) {
LinkTag node = (LinkTag) it.nextNode();
String link = node.getLink().trim();
// remove the anchor if present
if (link.contains("#")) {
link = link.substring(0, link.lastIndexOf('#'));
}