LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Click javascript button on web page programatically

Dear Forum Members,

I am currently working on interfacing LabVIEW with an IP camera's web interface. I've successfully filled in the login screen fields using the approach discussed in this forum post: http://forums.ni.com/t5/LabVIEW/How-to-fill-out-and-submit-a-web-form-using-LabVIEW/td-p/289527.

However, I'm facing challenges in programmatically clicking the buttons, particularly the one for taking a snapshot on the main screen. I have attached screenshots of the login page and the main screen, along with the relevant HTML and minified JavaScript files.

Any guidance on how to proceed with this and successfully trigger button clicks would be greatly appreciated.
https://iqratechnology.com/academy/javascript-training/

Thank you,
[IQRA Technology] 

0 Kudos
Message 1 of 6
(994 Views)

Dear LabVIEW Community,

I am currently working on integrating a local hardware device into LabVIEW that provides status data through a web interface. By accessing the device's URL in a browser and opening the console, I can retrieve status variables using the command "response [x]" in the JavaScript console.

I am looking for a way to efficiently load the website and open the JavaScript console within LabVIEW to request and monitor these variables programmatically. As there is no documentation on alternative communication methods with the hardware, any insights or guidance on achieving this integration in LabVIEW would be greatly appreciated.
https://iqratechnology.com/academy/javascript-training/js-variables/

Thank you,
[IQRA Technology] 

0 Kudos
Message 2 of 6
(994 Views)

You can look into headless browser / browser API tools: https://en.wikipedia.org/wiki/Headless_browser - or try some scripting with some input scripting tool like https://en.wikipedia.org/wiki/AutoHotkey

 

In general, I would recommend switching over from the JavaScript Console to observe the "Network" tab while working on the device. A more direct solution might come up.

Message 3 of 6
(931 Views)

I have used javascript to simulate a mousclick, however that was in a completly different context. 

 

https://www.geeksforgeeks.org/how-to-simulate-a-click-with-javascript/#:~:text=The%20click()%20metho....

0 Kudos
Message 4 of 6
(904 Views)

oh, and you haven't attached anything

0 Kudos
Message 5 of 6
(864 Views)

@iqratech wrote:

rowser and opening the console, I can retrieve status variables using the command "response [x]" in the JavaScript console.

I am looking for a way to efficiently load the website and open the JavaScript console within LabVIEW to request and monitor these variables programmatically. 


oh... I have overlooked that sentence

 

how do you spawn the browser inside labview? are you using that deprectaed activex method?

better use the dot net browser https://forums.ni.com/t5/LabVIEW/OpenStreetMap-GPS-track/m-p/4216487#M1222608

0 Kudos
Message 6 of 6
(859 Views)