Library to query HTML with XPath in Java?

There are several different approaches to this documented on the Web:

Using HtmlCleaner

Using Jericho

I have tried a few different variations of these approaches, i.e. HtmlParser plus the Java DOM parser, and JSoup plus Jaxen, but the combination that worked best is HtmlCleaner plus the Java DOM parser. The next best combination was Jericho plus Jaxen.

Leave a Comment