I've been trying to scrap the following webpage with cheerio in order to get the latest temperature and humidity rate for a little project of mine: Website link
Unfortunately, it seems like I've got to dig through a lot of tags and I can't find my way around. I've tried to inspect the element to see its css path but it did no good. The code I've tried is the following (it's based on the css selector I get when I inspect the element):
setInterval(function getTempAndHumidity()
{
var url =
{
url: "http://www.meteociel.fr/temps-reel/obs_villes.php?code2=7630",
method: 'GET',
proxy: webproxy
};
request(url, function (error, response, body)
{
if (!error && response.statusCode == 200)
{
$ = cheerio.load(body);
console.log($('tr.texte > td:nth-child(2) > table:nth-child(2) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > center:nth-child(18) > table:nth-child(3) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(5) > div:nth-child(1)').html());
}
else
{
console.log("Error when getting the temperature and humidity rate: " + error);
}
})
}, 2000);
I just get 'null' so it doesn't seem to work.
It would be a huge help if someone could give me a hand on this matter!
Thanks in advance