Here you can find the source of getSingleElement(final Elements elements)
public static Element getSingleElement(final Elements elements)
//package com.java2s; //License from project: Open Source License import org.jsoup.nodes.Element; import org.jsoup.select.Elements; public class Main { public static Element getSingleElement(final Elements elements) { if (elements.size() != 1) { throw new IllegalArgumentException( "A single element matching the criteria was expected. Instead, found " + elements.size()); }/*from w w w . j av a2 s. com*/ return elements.first(); } }