Currently, I am attempting to retrieve weather data from the following website:
using this code snippet:
try {
int i = 0;
if (googlefirst3.startsWith("http")) {
Document document = Jsoup.connect("https://www.ilmeteo.it/meteo/Magenta/previsioni-orarie?refresh_ce").userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11 Firefox/19.0").timeout(0).get();
Elements temp = document.select("tr");
String verifica;
verifica=document.html();
for (Element movielist : temp) {
i++;
html = (i + "|||" + movielist.getElementsByTag("td").first().html());
array3b[i] = html;
}
}
} catch (IOException e) {
e.printStackTrace();}
I am specifically interested in extracting the table rows containing temperature, wind, and time information:
https://i.sstatic.net/cLbNc.png
However, despite my efforts, I have been unsuccessful in retrieving this data. The document retrieved does not seem to include this information and appears incomplete. Initially, I suspected that the issue might be related to JavaScript-generated HTML, but even after trying a different method as suggested here:
How do I get the web page contents from a WebView?
I still faced difficulties. At this point, I am uncertain whether JavaScript is the root cause of the problem. Could someone provide assistance in determining the nature of the issue? Your help would be greatly appreciated.
Thank you in advance.