0

I am currently trying to use a web browser created dynamically in code to extract details in a web page, but I am unable to know when the load is complete. I know there is a .LoadCompleted event. I tried it and it is not firing for some reason, so I dropped it. But I am kind of looking for the type where we used to do for winforms webbrowser control. I'm checking if the document is ready like this:

Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete
  Application.DoEvents()
Loop

Is there anything similar? So that I can check and continue with the rest of the code.

Brian Webster
  • 30,033
  • 48
  • 152
  • 225
manu vishwanath
  • 97
  • 1
  • 1
  • 14
  • as mentioned I am creating the webbrowser on the fly and it is not visible. I am creating and destroying it because I have to loop through lot of web pages and frequently used to get "out of memory" message – manu vishwanath Feb 11 '13 at 08:04

1 Answers1

0

Make sure your web browser control is visible. Some events may not fire if the web browser control is hidden.

Related: LoadCompleted Not Firing in WPF WebBrowser Control

References

Community
  • 1
  • 1
Brian Webster
  • 30,033
  • 48
  • 152
  • 225
  • i dont want it to be visible. is there any other method. i can use forms webbrowser. but i will have to use doevents to get that running and loading. and i really want to avoid that as much as possible – manu vishwanath Feb 12 '13 at 04:54
  • Just make it visible, pull the data, then make it invisible again. That's the only way it is going to work unfortunately. – Brian Webster Feb 12 '13 at 04:55