Here you can find the source of containsLink(Element element, String link)
public static boolean containsLink(Element element, String link)
//package com.java2s; //License from project: Open Source License import org.jsoup.nodes.Element; public class Main { public static boolean containsLink(Element element, String link) { int links = 0; for (Element child : element.children()) { if (child.tagName().equals("a") && child.hasAttr("href") && child.attr("href").contains(link)) links++;// w w w . j ava2 s.co m } return links > 0; } }