import net.htmlparser.jericho.*;
public class HtmlParserExample {
public static void main(String[] args) throws Exception {
String html = "<html><body><h1>Hello, World!</h1></body></html>";
Source source = new Source(html);
Element h1 = source.getFirstElement("h1");
if (h1 != null) {
System.out.println("Found h1 element: " + h1.getTextExtractor().toString());
}
}
}