I'm a complete newbie to this, but I'm trying to put together some code that will automatically download a .csv file from a webpage every hour and save it to my computer (preferably a specific place). The data is hourly rainfall data from Scotland at the following website.
http://apps.sepa.org.uk/rainfall
Basically I need to be able to select one of the sites in the map on the left (it'll be the same site each time) and download the hourly rainfall .csv file from the dropdown menu on the upper right hand side of the graph. When doing it manually you hover over the download button, then hover over "Download as..." then select "CSV" when it comes up.
From what I've read on here, the Chrome Tampermonkey extension used in conjunction with the Windows Task Scheduler might be the best way to do this. From the previous question there is the code:
document.getElementById("download_button").click();
I've tried to replace the "download_button" section with something that might describe the ID of the CSV button element on the page, such as using 'CSV'; but I'm really not sure what the element ID of the button is. I've tried inspecting the element in the source code but as I'm new to this I don't really know what I'm looking for.
I also tried to search for the element by class and by path but again I was really unsure as to what value for the class and path to put in to get to the specific download button I required.
document.getElementByClass("export-main").click();
document.getElementByPath("//*[@id=\"chartdiv\"]/div/div[2]/ul/li/ul/li[1]/ul/li[3]/a/span").click();
Any help would be greatly appreciated, I'm not even sure if it's possible or if this is the best way to go about it.
Thank in advance for any help you might be able to give me.