I have used this code :
String innerHtml = Jsoup.parse(htmlCode,"ISO-8859-1").select("body").html();
But it only removes <html>
tags
Any HTML
tags inside the body
will still appear
Use .text()
instead of .html()
to get the combined text of the element and all of its children.
Try using .text()
:
Jsoup.parse(htmlCode,"ISO-8859-1").select("body").text();
Instead of .html()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With