I am using jsoup to extract content from a webpage. But i want to break the paragraph and display the content on a line by line. This code does not display line by line.Code
You print the content paragraph by paragraph in the loop, but you're appending the paragraphs to the StringBuilder without appending line breaks.
final String lineBreak = System.getProperty("line.separator");
StringBuilder sb = new StringBuilder();
for (org.jsoup.nodes.Element el : els) {
sb.append(el.text());
sb.append(lineBreak);
}
System.out.println(sb.toString());