Here you can find the source of getTitle(Element el, String[] titles)
public static Element getTitle(Element el, String[] titles)
//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 getTitle(Element el, String[] titles) { for (String title : titles) if (el.tagName().equals(title)) return el; Elements subsectionTitles = new Elements(); for (String title : titles) subsectionTitles.addAll(el.select(" " + title)); // if(subsectionTitles.size() != 1) // { // System.out.println("problem with title"); // return null; // } // else return subsectionTitles.get(0); }/*from w ww .j a v a 2 s . c o m*/ }