Using Jsoup i try to parse the given html content. After Jsoup.parse() the html output append html, head and body tag to the input. I just want to ignore these.
To get the expected output it would actually be:
final String html = "This is my sentence of text."; Document doc = Jsoup.parseBodyFragment(html); doc.outputSettings().prettyPrint(false); System.out.println(doc.body().html());
This is my sentence of text.