I'm working on an application to programatically fill out and submit web forms through LabVIEW. My issues arise when I try to click the "Submit" button. I've tried what's been suggested on other posts, which is creating a reference to the form, then using the Invoke Node for a IHTMLFormElement object to call the "submit" function. Unfortunately this doesn't work for me and I'm not sure why. So I've decided to take another approach, which is finding a reference to the Submit button, and then issuing the "click" method from the IHTMLElement invoke node. The main drawback is the web server HTML doesn't have id's for the buttons, so I'm trying to use the tags method in the invoke node. In the picture below I'm trying to get a reference to the button with tabindex=2. This is the save button I'm trying to get clicked.
And herein lies my main issue, no matter what index I use I only get a reference to the Cancel button, and not the Save button. I think it may be something to do with the "type" associated with the save button. Does anyone have any experience with this sort of issue? Please see the below VI. I've also attached a copy. Any help is greatly appreciated.
Update: I've been working on this and have found that the tags invoke node is returning an Element Collection of length 2 - one should be for the Cancel button, and one should be for the Save button. I still can't figure out how to access the Save button though.
It's been a really long time since I've done web scraping, but I think you can just use the HTTP Client VIs to manage this?
I was trying to steer away from that as I'm not too familiar with the protocol... However if this is the only way of doing it then I'll have to learn!
I'm not gonna lie; it'll be painful. 😞 I think W3Schools can help a lot.