cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Selecting HTML objects by tag name

Highlighted

Selecting HTML objects by tag name

Hello forum,

 

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.

 

 image.png

 

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.

 

vi.PNG

0 Kudos
Message 1 of 6
(80 Views)

Re: Selecting HTML objects by tag name

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. Smiley Frustrated

0 Kudos
Message 2 of 6
(58 Views)

Re: Selecting HTML objects by tag name

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?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 6
(55 Views)

Re: Selecting HTML objects by tag name

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!

0 Kudos
Message 4 of 6
(53 Views)

Re: Selecting HTML objects by tag name

I'm not gonna lie; it'll be painful.  Smiley Sad  I think W3Schools can help a lot.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 6
(49 Views)

Re: Selecting HTML objects by tag name

Thanks Bill. I'll start on that and hope for another response Smiley Wink

0 Kudos
Message 6 of 6
(47 Views)