LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read html

Could anyone tell me if its possible to use labview to scrape a web page to display desired data on a front pannel?  For instance scrapping weather conditions, share prices etc.  If anyone has an example of a code which does something like this would be great. 
Cheers
0 Kudos
Message 1 of 11
(4,074 Views)
Hi Sniepsy,

there are standard TCP/IP functions in LabView. You can also use Datasocket-functions to retreive data like pictures etc...

Have you searched the forum? Or take a look at the examples of Labview!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(4,063 Views)
Hello Sniepsy,
 
As GerdW alluded to, you could read the entire HTTP response from a web server using the TCP/IP functions in LabVIEW. There is an example of this here:
 
 
Of course, you'll have to parse the resulting string you want! 😉 You may also be able to use a web service (.NET or otherwise) to pull the information you want from the web. This sort of thing is common for stock quotes, etc. We have an example of doing this on our website as well, but there's probably fancier methods:
 
Invoking a .NET Web Service from LabVIEW
 
You could also just put an ActiveX container on your front panel with a web browser embedded. That would just show the whole thing without any programming or parsing at all.
 
Just some thoughts -- hope this helps!
Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
0 Kudos
Message 3 of 11
(4,053 Views)
As Charlie mentioned, it sounds like the web browser ActiveX control might be the easiest thing for you. Here's a simple example:
0 Kudos
Message 4 of 11
(4,045 Views)

If you emplos a .net web service let me know how this goes.  I have been curious about incorperating web services into labview for a while.  Actually parsing the webpage and reformating it into a new webpage (or simply removing the value you desire) is rather strait forward.  Take the original HTML code, (use tcp reads with an ip url) and simply parse the string for the desired value.  ie <weather><temp unit = 'F">90.0<\temp>....<weather> is a simple string which can be parsed with a <temp units = 'F'>%f<\temp> for example.  There are alot of web services which are interesting and I havent gotten around to wiring them up to a vi.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 11
(4,038 Views)

I am only new at LabView so I apologies for my questions in advance. That’s for that simple VI smercurio_fc but I cant for the life of me figure out how you got the WebBrowser Control/ display on the front panel wired to the reference input of the invoke node. Can anyone help explain?  Furthermore, is there any way in labview to click on an icon such as this and get some help on where to find it in the pallet, because there is no quick help for it.

0 Kudos
Message 6 of 11
(4,016 Views)
Forget that last post, I just foud it, but now my next question is how is it acting as a control? It seems to be just displaying the URL which is input. An explination would be most appreciated.
Cheers
0 Kudos
Message 7 of 11
(4,014 Views)

To use activex components in Labview, drop an activeX container, right click and choose browse for the class.  In this case a microsoft browser is used but there are thousands of activeX components to do this with.  Yes its that simple.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 11
(3,997 Views)
Sniepsy, I'm not sure, but was your question answered?
0 Kudos
Message 9 of 11
(3,993 Views)
Hi, Yes questions is definately answered, but with every question and answer it has brought on a bunch more questions, such as logging into secure sites. I have posted another question about this because i have worked through the online discussion about auto logon but cant get it to work with my online bank at https://www.national.com.au/cgi-bin/nolt/nolt_1.pl  .  If any of you can take a look at my code and give me some insite would be great.

Regards
0 Kudos
Message 10 of 11
(3,980 Views)