tum Posted April 24, 2007 Report Share Posted April 24, 2007 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 Quote Link to comment
Aitor Solar Posted April 24, 2007 Report Share Posted April 24, 2007 QUOTE(tum @ Apr 23 2007, 06:02 AM) 1.How to get HTML code form webpage (etc. www.google.co.th,www.lavag.org) by labview 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 Saludos, Aitor Edited to add the user/password fields. Quote Link to comment
LAVA 1.0 Content Posted April 24, 2007 Report Share Posted April 24, 2007 CITATION(Aitor Solar @ Apr 23 2007, 10:15 AM) ... since just "http://www.google.com''>http://www.google.com' target="_blank">http://www.google.com" provokes a LV crash. Strange behaviour, by the way 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 ! Quote Link to comment
Aitor Solar Posted April 24, 2007 Report Share Posted April 24, 2007 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 Quote Link to comment
LAVA 1.0 Content Posted April 24, 2007 Report Share Posted April 24, 2007 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... Quote Link to comment
Aitor Solar Posted April 24, 2007 Report Share Posted April 24, 2007 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 . Saludos, Aitor Quote Link to comment
Mikkel Posted April 24, 2007 Report Share Posted April 24, 2007 QUOTE(Aitor Solar @ Apr 23 2007, 11:52 AM) 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 .Saludos, Aitor I just tested the code with Windows XP / LabVIEW 8.0.0 (only version I have here), and it seems to crash on all URLs (www.google.com, www.ibm.com, www.lavag.org) if I don't supply the '/index.html' - so it's probably not because of the patch... Edit: If I remove the '[text]' string from the code, it does not crash. -Mikkel Quote Link to comment
crelf Posted April 24, 2007 Report Share Posted April 24, 2007 QUOTE(Mikkel @ Apr 23 2007, 09:04 PM) Edit: If I remove the '[text]' string from the code, it does not crash. 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. Quote Link to comment
Aitor Solar Posted April 24, 2007 Report Share Posted April 24, 2007 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 Quote Link to comment
Mikkel Posted April 24, 2007 Report Share Posted April 24, 2007 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... http://forums.lavag.org/index.php?act=attach&type=post&id=5603 -Mikkel Quote Link to comment
tum Posted April 25, 2007 Author Report Share Posted April 25, 2007 Thank you for help,Now my problem is solve. Quote Link to comment
Rolf Kalbermatter Posted May 16, 2007 Report Share Posted May 16, 2007 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.