You don't have to do the parsing yourself line by line, Jsoup has methods to do that. The HTML is already parsed in the JSOUP Document you created. You can now access its elements one by one, or in a grouped fashion. The possibilities are endless, take a look at the official docs: https://jsoup.org/cookbook/

To answer your question nonetheless, to split the whole HTML String by newlines, you could do this: