-
WebBrowser
I have some difficulties using the WebBrowser control which I don't seem to be able to overcome.
The problem is that there is no way to indicate when it has fully navigated on a webpage. It seems to do it by steps.
The only thing available seems to be the Navigated Event Handler. But it doesn't seem to work. It fires up twice but still the page is not fully loaded.
What I do is after the page loads I use the GetElementById() method to get what I want, but it doesn't always work.
I tried to use a while(..) loop with GetElementById() method and that part works. It waits until that element loads. Until here OK.
The thing is that I want to search also for elements that might not exist. I simulate a Search Engine search, so some elements will be missing depending on the search (like if there are no results or if there are no sponsored links).
The only thing I can think is to put a delay. I know that works, but it will slow a lot the whole search, where speed is kind of an issue. It is an issue because somebody might have a very fast or a very slow connection so there is no way to put a constant delay that will work for everybody
-
-
Argh! How didn't I miss that? Was looking for something like that for a long time.
Though, it doesn't work completely. For example it first twice. Well, that can be fixed of course, but it is kind of risky in the sense that "does it fire twice all the time or will it make it freeze on some occasions?"
Still have some problems, but I will work on them. It is much better than Navigated since now I know that the Document has also loaded (one step further).
Thanks a lot :)