I am trying to get some data provided by the National Weather Service. Unfortunately, this particular website does not embed the data in the html that is returned from a URL request. Instead they initiate a download of the data to the local machine as a text file. Fine, I can read that file. But I’m having trouble automating this with XOJO.
Idea 1: Using the URLConnection.Send(“GET”, URL) method does not work because the data is not contained in the returned html. And this does not imitate the file download.
Idea 2: Using the WebViewer. But XOJO takes the file destined to be downloaded and displays it in the viewer. And I can’t seem to programmatically get at what is displayed there (I think this is for security reasons). I can copy and paste it manually but that isn’t what I want.
So I’m stumped at how to get this data. I searched for and found some 3 year old posts on using javascript for this. Is that still the best or only way? I know javascript somewhat but have never implemented this with XOJO.
A sample of what I am after can be generated with the following url. Try this first in the browser of your choice and you’ll see the resulting text file I’m after.
“https://www.weather.gov/mdl/nbm_text?ele=nbs&sta=kmry,kpdx&download=yes”
Any help would be appreciated. Thx