LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i get data from a website?

I am trying to access weather data such as visibility and rain from a website preferably BBC or MET office and display it on the frontpanel. I really don't have the first idea about how to go about it. I am making a programme to automatically open and close a telescope dome in undesirable weather and thought that this information from the net would make a great addition allowing the group that uses it to plan their viewing schedule without going online seperately but having it all right in front of them. Could anybody help me with this?
0 Kudos
Message 1 of 21
(20,840 Views)

Hi Dan_,

you can use DataSocket to read the content of a website. Parse the result for the information you need. Another solution would be to use the ActiveX control and load the website there.

 

Mike

0 Kudos
Message 2 of 21
(20,824 Views)
Here is a program I use to get local weather data off the web, it is an example of the Data Socket method Mike spoke about.  VI's are in LV8.0
Message 3 of 21
(20,820 Views)
If it's sufficient for you to simply display a web page directly, without extracting data from it, and you're on a Windows machine, ActiveX is definitely the simplest way to do it.  You can embed an Internet Explorer window in your front panel, let your LabVIEW code tell it what URL to load, and you're all set.  Take a look at the ActiveX Event Callback example, which is more complicated than you need but fairly simple and demonstrates an embedded Internet Explorer object.  You can also use IE to retrieve specific elements from a website and fill in a form, although that gets to be more complicated; see the Microsoft Developer Network (MSDN)  documentation.
Message 4 of 21
(20,811 Views)

 


Awesome_Larry escreveu:
Here is a program I use to get local weather data off the web, it is an example of the Data Socket method Mike spoke about.  VI's are in LV8.0
Can you send the code for LabVIEW 7.0?
0 Kudos
Message 5 of 21
(19,620 Views)

@yklys wrote:

   Can you send the code for LabVIEW 7.0?


To save you some time, because not that many people have access to LV 8.0 and 7.1 anymore, the code to retrieve the HTML is very simple. You call Datasocket Read and in the URL input you feed "URL[text]" (for example "http://www.google.com[text]"). You also wire the URL to the second input, which determines the data type. This will cause the function to download the file at that URL and output it as a string.


___________________
Try to take over the world!
Message 6 of 21
(19,613 Views)

tst escreveu:

@yklys wrote:

   Can you send the code for LabVIEW 7.0?


To save you some time, because not that many people have access to LV 8.0 and 7.1 anymore, the code to retrieve the HTML is very simple. You call Datasocket Read and in the URL input you feed "URL[text]" (for example "http://www.google.com[text]"). You also wire the URL to the second input, which determines the data type. This will cause the function to download the file at that URL and output it as a string.

Thanks.

 

0 Kudos
Message 7 of 21
(19,610 Views)

Does anyone know how to get a list of all store addresses from a retailer's website?  All of the information is in the Store Locator function but there is generally no easy way to get a full list.

0 Kudos
Message 8 of 21
(18,684 Views)

Most likely that information is not on the website but in a database somewhere. Pressing the search button on the web page causes the server to run a database query and return the results to the webpage. Most likely you would need to run a series of queries to retrieve the information. For example test every possible ZIP code.

 

Lynn

0 Kudos
Message 9 of 21
(18,676 Views)

Thanks - do you know if there is way to automate that? Or would I have to type it in each time?

0 Kudos
Message 10 of 21
(18,670 Views)