Read a list of websites, get rid of HTML tags and write it all into a txt file

80 Views Asked by At

I am trying to get a list of websites to be read once at a time and printed to a single file. I would also like the html tags to be extracted which I plan to use jsoup for HTML parsing. How would I do this before writing the content to the file?

1

There are 1 best solutions below

1
On

The Exceptionis quite self-explanative.

There is no next element because, quoting API:

if no more tokens are available

Wrap your assignment in a a while (myScanner.hasNext()) loop after initializing your Scanner.