Class HTMLParser

java.lang.Object
com.github.westsi.browser.util.html.HTMLParser

public class HTMLParser extends Object
Lexes and parses source HTML into a tree of HTMLElements. Supports HTML Entities and self-closing tags.
See Also:
  • Constructor Details

    • HTMLParser

      public HTMLParser()
  • Method Details

    • parse

      public HTMLElement parse(String body)
      Parses the HTML source to the DOM Tree.
      Parameters:
      body - The HTML source text to be parsed.
      Returns:
      The root of the DOM tree which will be a HTMLElement.
    • printTree

      public void printTree(HTMLElement node, int indent)