LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET web browser clicking button doesn´t work all the time

Solved!
Go to solution

Hey guys,

I´m currently working on an application that gives the user the opportunity to select images from google and download them. My idea is that the user types in an object he wants to search for. The application searches for that object. Then all the google images are displayed one after another and the user can click to download the image or not.

So, my first step was to create a .NET web browser and navigate to google image, type in the object name which the user likes to search for and click the search button. After that, I get the URL of the first image shown by google and navigate to it. Afterwards I programmatically click the "next" button every time the user clicks "download" or "not download". In the current version of the application, the images are switched every second just to test the functionality.

 

Now the problem is that clicking the search button after typing in the object name does not work all the time. My guess: When clicking the search button, I use the same document reference then before writing to the search field. So I´m searching for an empty string. But like mentioned - sometimes it works. I furthermore could not find any .NET event or property to wait until the document is updated before I click the button. Has anyone any idea what I´m doing wrong? I´m absolutely new to .NET. I´ll attach a snipped of my VI. I know I should close all the references and so on but this is just a test VI.

 

0 Kudos
Message 1 of 7
(3,333 Views)

By the way - I tried doing the same thing with activeX instead of .NET. Same behaviour. Writing to the search field and clicking the button work perfectly until I try to do both in a row.

0 Kudos
Message 2 of 7
(3,318 Views)

The VI snippet is broken for me.  Can you just attach the whole VI as a file, as well as attaching the snippet as a file (i.e. not in-lining as an image)

 

There's a notice at the top of the board indicating they know that snippets are having issues at the moment.

0 Kudos
Message 3 of 7
(3,299 Views)

Off course, Kyle. Thank your for the hint! You´ll find the files attached.

 

 

Download All
0 Kudos
Message 4 of 7
(3,262 Views)

I totally forgot. You will also need this SubVI

0 Kudos
Message 5 of 7
(3,186 Views)

Has no one any idea? 

0 Kudos
Message 6 of 7
(3,156 Views)
Solution

I got it to work. If I use another google image page as starting page, it works great. I´ll attach the VIs.

 

Download All
0 Kudos
Message 7 of 7
(3,151 Views)