Here you can find the source of getLink(Element element, int index)
public static String getLink(Element element, int index)
//package com.java2s; //License from project: Open Source License import org.jsoup.nodes.Element; import java.util.List; public class Main { public static String getLink(Element element, int index) { try {//from w ww. j a va 2s .com List<Element> elements = element.getElementsByTag("a"); return elements.get(index).attr("href"); } catch (IndexOutOfBoundsException e) { throw new NullPointerException(); } } }