Here you can find the source of getIcon(Document doc)
public static String getIcon(Document doc) throws URISyntaxException
//package com.java2s; //License from project: Open Source License import org.jsoup.nodes.Document; import java.net.URI; import java.net.URISyntaxException; public class Main { public static String getIcon(Document doc) throws URISyntaxException { String meta;/*from w w w.j a va 2 s. c om*/ try { meta = doc.head().select("link[href~=.*\\.ico]").first().attr("abs:href"); } catch (NullPointerException ignored) { String uri = new URI(doc.location()).getHost(); return uri.endsWith("/") ? uri + "favicon.ico" : uri + "/favicon.ico"; } return meta; } }