Answer the question
In order to leave comments, you need to log in
Writing a collection to a file, how to do it right?
there is a parser
try{
//конектимся
Document doc = Jsoup.connect("http://" +parserParam).get();
//добавляем в список из элементов все что лежит между тегами <html> </html>
List<Element> elements = doc.select("html");
//выводим на клиента все что спарсилось
out.print(elements);
}
//перехватываем исключение если че
catch(Exception e){
e.printStackTrace();
out.print("ERROR, possible somthing wrong with your query");
}
//закрываем поток вывода
out.close();
Answer the question
In order to leave comments, you need to log in
In what format?
The simplest is to convert your List to json using any of the 100500 libraries (I like Gson for example), and write to the file as a string.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question