In the project, I receive the HTML code with the String string. From it it is necessary to remove certain blocks and add some. I heard that there is some kind of literate class for this, but I just can’t find the information I need ...

Tell me, please, what to do?

ps do not really want to write bulky code manually.

  • [come down?] [1] [1]: jsoup.org - sonniy
  • I ran across jsoup, but I’m too much ... I’m only getting a line, and not pick up the code from the Internet. but ATP.) - Simkhotech

2 answers 2

For example HtmlUnit .

If it is XHTML - that is, a piece of valid XML, then it is easier to use standard SAX

PS By the way, cutting down the validity check - you can also use SAX for ordinary HTML.

  • I have only HTML ... - Simkhotech