Is there a parser/library which is able to read an HTML document into a DOM tree using Java? I\'d like to use the standard DOM/Xpath API that Java provides.
DOM/Xpath
Use https://jsoup.org , this is very simple and power.can read and change a html.
Sample:
Document doc = Jsoup.parse(page); //page can be a file or string. Element main = doc.getElementById("MainView"); Elements links = doc.select(".link");
for create elements can use j2html, https://j2html.com