Hello everyone,
I'm new here and I'd like to get some directions about the htmlparser usage.
I need to go through a html code and update each link (href content) with a
new one. Like: <a href="www.google.com"> will become <a href="
www.mysite.com/click?link=www.google.com">
First I tried using the javax.xml.parsers and org.w3c.dom but the problem is
I get an exception if I try to parse an invalid xhtml by w3c. I can't work
like this because some users may post html codes generated by designer tools
which formatting may not be valid by w3c.
I could write some regex to do this but I heard about htmlparser and I would
like to know if it can help me with this.
Any suggestion will be appreciated.
Thank you
Wagner Montalvão Camarão
|