LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to manage web page content via labview

My pproblem is to get cyclic information from a web page containing an
applet.
Using a container I cannot manage any text and object in the page. Isn't it?

Ciao


0 Kudos
Message 1 of 5
(3,463 Views)

If I understand you correctly, you are hosting a webpage in a front panel ActiveX container, and you want to obtain certain information from the webpage.

This is possible using ActiveX calls. To get access to the HTML document in the container itself, along with all of its text and applets, etc, you need to reference the Document child item from a property node. This item is variant, so you need to use Variant to Data with a ActiveX refnum constant set to MSHTML.IHTMLDocument2 wired to the type. At that point you can access information about the HTML page itself, such as the body's text and so forth.

I'm attaching a simple example that should help you get started. It's written in LabVIEW 7.1. Good luck!

Jarrod S.
National Instruments
0 Kudos
Message 2 of 5
(3,432 Views)

"Jarrod S." <x@no.email> wrote in message
news:1140028999545-325331@exchange.ni.com...
> If I understand you correctly, you are hosting a webpage in a front panel
ActiveX container, and you want to obtain certain information from the
webpage.
> This is possible using ActiveX calls. To get access to the HTML document
in the container itself, along with all of its text and applets, etc, you
need to reference the Document child item from a property node. This item is
variant, so you need to use Variant to Data with a ActiveX refnum constant
set to MSHTML.IHTMLDocument2 wired to the type. At that point you can access
information about the HTML page itself, such as the body's text and so
forth.
> I'm attaching a simple example that should help you get started. It's
written in LabVIEW 7.1. Good luck!
>
>
> HTML Document Info.vi:
> http://forums.ni.com/attachments/ni/170/167660/1/HTML Document Info.vi


Thanks a lot!!!,
maybe you didn't grab 100% of my needs because of my student english.
But for sure you are close to 90%.
Your solution is perfect but it takes time (and band) to download the entire
page. Is it possible to retrieve the HTML code?

So I try to ask you


0 Kudos
Message 3 of 5
(3,419 Views)

Hi again!

Yes, you can directly access the html source code. This is extremely easy in LabVIEW using the DataSocket VIs. DataSocket is a general high-level network communication platform that allows LabVIEW to transmit and receive data between computers and other applications. One of its many uses involves reading html source code from web servers.

I've attached an example. Pretty easy, isn't it?

Jarrod S.
National Instruments
0 Kudos
Message 4 of 5
(3,413 Views)

Hmm...

I used this method since Labview 6.0, but I remember it  doesn't work with URL ends with ".html"Smiley Tongue

Try to open URL http://www.x-rates.com/d/KRW/EUR/data120.html for example and you'll see ERROR 1184

But if you try http://www.x-rates.com  everything works fine. Can you guess why?

Of course Activex method is little more complex but works everytime.

 

0 Kudos
Message 5 of 5
(3,202 Views)