Here you can find the source of isHTMLEmpty(String textToCheck)
public static boolean isHTMLEmpty(String textToCheck)
//package com.java2s; /**/*www . j ava 2s.c om*/ * License: https://github.com/votingsystem/votingsystem/wiki/Licencia */ import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; public class Main { public static boolean isHTMLEmpty(String textToCheck) { String emptyContent = "<p><br></p>"; Document doc = Jsoup.parse(textToCheck); Elements elements = doc.select("body").first().children(); if (elements.size() == 0) return true; for (Element el : elements) { if ("".equals(el.toString()) || emptyContent.equals(el.toString())) return true; } return false; } }