Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Library to remove HTML tags and comments

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for a tool that takes HTML as an input and return text as an output. Basically I want to remove all HTML tags and Comments from my string. Is there any Opensouce library for that?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parsing random HTML is not simple. Consider the JTidy open source toolkit to get HTML into a parsed form.

Bill
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get the Text in an HTML document using the javax.swing.text.html parser.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic