Here you can find the source of getOneSubItemOfClass(Element parent, String className)
public static Element getOneSubItemOfClass(Element parent, String className)
//package com.java2s; //License from project: Apache License import org.jsoup.nodes.Element; import org.jsoup.select.Elements; public class Main { public static Element getOneSubItemOfClass(Element parent, String className) { return getOneSubItemOfClass(parent, "div", className); }/*from ww w. jav a 2s . c o m*/ public static Element getOneSubItemOfClass(Element parent, String tag, String className) { Elements select = parent.select(tag + "[class*=" + className + "]"); if (select.size() != 1) throw new IllegalStateException("not one item of class " + className); return select.first(); } }