Ayorus
Ayorus

Reputation: 507

C# WebBrowser DocumentCompleted event not firing with specific site

I have got an App which collects info from some sites on the web. It works properly for most of them, however, I just notice there is one specific site for which the DocumentCompleted event is not firing.

I have already patched the problem. If after some time the main process does not initiate it will start automaticaly. I think that will be enough, however I would like to know any other's opinion about the possible reason of this.

The Website which producess the behavious is: http://www.elinformador.mx/

Any help or opinion will be appreciated.

Regards

PD. There are some questions related to this topic, hovewer, this one relates to a very specific problem.

Upvotes: 2

Views: 712

Answers (1)

Judah Gabriel Himango
Judah Gabriel Himango

Reputation: 60041

As I recall, this can happen in certain scenarios with iframes and AJAX calls.

Have you tried something like this instead:

webBrowser.Navigate("http://www.elinformador.mx");
while (webBrowser.ReadyState != WebBrowserReadyState.Complete)
{
    Application.DoEvents();
}

// The page is done loading. Do whatever now.

Upvotes: 4

Related Questions