Ok so im building a list of a lot of cities to find out each morning who had rain yesterday, and exactly how much.
This source/site "https://weather.gc.ca/city/pages/on-121_metric_e.html tells me that, it shows the rain in mm for yesterday near the bottom and the city. But some pages may not show the rain for that day occasionally.....
So the script errors out. Below is just three examples of an actual number of 93 cities..

So I coded If statements if class dl-horizontal wxo-yest-col2 isnt available then next, and the first result was yes its there.. second again yes... the third page ( I know its not there but the statement still says it is.. but its not) .. anyhow I tried setting objects, and if dl-horizontal wxo-yest-col2 greater than 0, i tried 7 different ways from the net. Is it actually something to do with Class?? maybe Class doesnt allow this?? I know GetelementbyID works... but I need it to check for the class, and if its not there.. just skip and move on to next city..

If you try this make an excel page "WEATHER"... and lemme know what im doing wrong.

Below is the clean code, before I added all kinds of check methods, and basically most of the code was in green after 6 hours of attempts lol..

Thanks for any help.

on both the pages down at "Yesterday's Data" one will show precipitation, the other has none.. theere fore the class isnt available on that page, and I need coding thats works to handle this by moving on.. instead of popping up errors when "yesterdays" area isnt displaying anything on the webpages.



Please Login or Register  to view this content.