12-09-2018 01:57 PM
Looking for a means to launch a webpage and fill in a box and then hit a search button to return a value. Found this VI and attempted to make it work with the digikey website but it has issues. Anybody know whats wrong here?
12-09-2018 03:22 PM
Please include a Snippet of your code, or attach a version of your VI in LV 2016 or older, so I can take a look.
I used to do some webpage automation with LabVIEW, but it's definitely not the easiest way to do it. I've since used Python and sometimes VBA to automate and found it much easier to do.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
12-09-2018 07:30 PM
12-09-2018 07:32 PM
That's still LabVIEW 2017
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
12-09-2018 08:27 PM
sorry here is lv 16
12-10-2018 08:27 AM
Hi id,
Can you please provide us with the subVIs being called by your code as well? The VI you uploaded requires "IE Set Element Value.vi" and "IE Button Click.vi" to run. Based on the leftover paths, these look like VIs that you downloaded as drivers for this application. It's trying to source them from my downloads folder so it's likely you can find them in the downloads folder on your machine.
For what it's worth, the code you have provided looks sound. However, the subVIs that are missing could be the source of your issue. It will be hard for us to help without seeing those VIs.
Best,
Duncan Waldrop
Applications Engineer
National Instruments
12-10-2018 10:31 AM
Duncan, his zip file in his last reply includes those subVIs.
I tinkered with this a bunch last night and couldn't get the node to return the proper reference to the digikey search bar. Maybe an Apps engineer can do it better. I can access the "header" element, but anything lower than that didn't work.
Is there a way to get an element using its class name instead of tag?
Good luck!
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
12-10-2018 11:50 AM
Oops... I was using the original linked VI instead of the .zip. Thanks for the catch!
I'll continue looking into this, but it's going to come down to a question of how to use Microsoft's MSHTML interface properly, which is not particularly well documented. If this is a pressing issue, I would recommend reaching out to Microsoft's support team to see if they can offer any insight into how their API is treating these function calls. For instance, it's hard to tell what each HTML element defined on Digikey's webpage is being bucketed as under the Microsoft API.
I can confirm that the reason this code is not working in its current state is that the IHTMLElementCollection property node is returning a collection of elements, since "keywords" is used as a name multiple times in the document. This causes the typecast and property node call to an IHTLMElement fails because the reference is not of this type. I'm working on getting a reference to the underlying search bar text element now.
James, I have found a couple of links now that claim searching by class name is not supported by Microsoft's API. I find this a little hard to believe so I'll keep looking. I'll let you know if I find anything.
-Duncan
12-10-2018 12:23 PM
Are we trying to search Google? Because if so you can just format the URL to have the search request in it. I've even used this in the past combined with the Feeling Lucky input so that Google takes me to the first hit page.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
12-10-2018 12:27 PM
@Hooovahh wrote:
Are we trying to search Google? Because if so you can just format the URL to have the search request in it. I've even used this in the past combined with the Feeling Lucky input so that Google takes me to the first hit page.
I think he's trying to search digikey
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'