Possible to parse a HTML document and build a DOM tree(java)

后端 未结 5 681
孤街浪徒
孤街浪徒 2021-01-07 07:54

Is it possible and what tools could be used to parse an html document as a string or from a file and then to construct a DOM tree so that a developer can walk the tree throu

5条回答
  •  离开以前
    2021-01-07 08:03

    You can use TagSoup - it is a SAX Compliant parser that can clean malformed content such as HTML from generic web pages into well-formed XML.

    This is bold, bold italic, italic, normal text
    
    gets correctly rewritten as:
    
    This is bold, bold italic, italic, normal text.
    

提交回复
热议问题