LagartoDOM
Parse HTML to a DOM tree.
Document document = new LagartoDOMBuilder()
.parse("<html><h1>Hello</h1></html>");
Node html = document.getChild(0);
Node h1 = html.getFirstChild();
System.out.println(h1.getTextContent()); // Hello
Text text = (Text) h1.getFirstChild();
System.out.println(text.getTextValue()); // Hello
System.out.println(text.getCssPath()); // html h1Parsing specification
Last updated
Was this helpful?