07-21-2017 08:56 AM
Hi,
I have a server unit (requires username and password) which I would like to gain access using the LabVIEW program. The program I am trying to create is to take the webpage's source code using HTTP through TCP.
However, when I run the program, I am unable to login and access the source code data inside.
The result I keep getting is the source code of the initial page which asks for a username and password.
I am not sure is what the problem is. I am using LabVIEW 2017.
Any help is appreciated.
Thanks
Data In
07-24-2017 03:44 AM
I suggest using the HTTP functions instead of TCP The HTTP open handle has login inputs, and then you can use the GET function to get the webpage html. Much more readable and easier to use than using TCP for this.
Secondly, make sure that the URL you are getting is actually the correct location. Often if you have to login to a website, you are then no longer looking at the same URL after the login. Or it may just redirect anyway. If you do HTTP GET with the url "www.ni.com", you just get a few lines back. When you type ni.com into an address bar, you'll see it just goes to the language homepage such as www.ni.com/en-us. If you HTTP GET on this, you see the actual homepage source.