Jump to content

How to get HTML code from webpage by labview


Recommended Posts

I have 2question?about this topic

1.How to get HTML code form webpage (etc. www.google.co.th,www.lavag.org) by labview

2.some webpage has protect(username and password prompt),do you have idea for access it from labview?

it look good if your example use LV7 or 7.1,

Thanks

Link to comment

QUOTE(tum @ Apr 23 2007, 06:02 AM)

As easy as this:

http://forums.lavag.org/index.php?act=attach&type=post&id=5602

Try "http://www.google.com/index.html", since just "http://www.google.com" provokes a LV crash. Strange behaviour, by the way :unsure:

Saludos,

Aitor

Edited to add the user/password fields.

Link to comment

CITATION(Aitor Solar @ Apr 23 2007, 10:15 AM)

Nice and simple solution Aitor !

What is you LV version ? Because with LV 8.20 the is no crash with "http://www.google.com", I just get no result and no answer... but no crash !

Link to comment

QUOTE(TiT @ Apr 23 2007, 10:39 AM)

What is you LV version ? Because with LV 8.20 the is no crash with "http://www.google.com", I just get no result and no answer... but no crash !

That VI is done with LV7.1.1f1, and the error alert before crash says: "The exception Breakpoint. A breakpoint has been reached.", that is also pretty strange, I think. I don't have any LV8+ connected to the web to check if it works, so I'll trust you ;). Probably just a bug that was corrected in later versions.

Saludos,

Aitor

Link to comment

CITATION(Aitor Solar @ Apr 23 2007, 11:15 AM)

That VI is done with LV7.1.1f1, and the error alert before crash says: "The exception Breakpoint. A breakpoint has been reached.", that is also pretty strange, I think. I don't have any LV8+ connected to the web to check if it works, so I'll trust you ;) . Probably just a bug that was corrected in later versions.

Saludos,

Aitor

I've just tested your VI with my LV7.1.1 and I get same behaviour as with LV8.20.

No crash, no error...

Link to comment

QUOTE(TiT @ Apr 23 2007, 11:33 AM)

I've just tested your VI with my LV7.1.1 and I get same behaviour as with LV8.20.

No crash, no error...

Umm. My LV7.1.1 has a NI patch to speed up remote panels, so maybe it added a bug to the data socket functions. At least, it's the only reason I can think of :wacko: .

Saludos,

Aitor

Link to comment

QUOTE(Mikkel @ Apr 23 2007, 09:04 PM)

Right - www.google.com isn't a webpage - it's a placeholder that will (by default) push you over to www.google.com/index.html, so asking DataSocket for the text of the page at www.google.com won't work. Also, as html code is ASCII text, you don't need the [text] switch with DataSocket, as it uses [text] by default.

Another example of web page parsing with DataSocket is downloading an image from a webpage.

Link to comment

QUOTE(crelf @ Apr 23 2007, 02:16 PM)

Right - www.google.com isn't a webpage - it's a placeholder that will (by default) push you over to www.google.com/index.html, so asking DataSocket for the text of the page at www.google.com won't work.

Well, not working, as in closing LabVIEW with the message attached below is a bit harsh.

I would prefer an error in the 'error out' cluster... :shifty:

http://forums.lavag.org/index.php?act=attach&type=post&id=5603

-Mikkel :)

Link to comment
  • 3 weeks later...

QUOTE(Aitor Solar @ Apr 23 2007, 07:35 AM)

It also works with the [text] suffix if you put the end slash: "www.google.com/" . Usually the web browser corrects that; my fault.

Anyway, I think LV shouldn't crash if I ask for text with something that is not text. An error code is OK, but a crash...

Saludos,

Aitor

OpenG has a VI that does this all in G. Works quite well and much less likely to create crashes :-)

Please not that this VI does just what it is asked. Meaning if you ask it to get a certain page that has a redirection it will do so which will only return a short status message and some redirection code which you need to parse and use to get the real page.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.