I have made all the necessary imports (Jsoup Elements and Element
) and the code runs well. I am a beginner and couldn't make the file export properly as a CSV. The data either stays on the same row or the same column.
Document document = Jsoup.connect("https://www.investing.com/markets/united-states").get();
Elements tables = document.select("tr");
tables.stream().forEach(e ->
{
String values = e.text();
String csValues = String.join(",", values);
System.out.println(csValues);
});
}
}
Looking for help. Thank you.