We become indebted to.
I'm writing a program that patrols the site and captures it in C #, but I'm having trouble with it.
I would be grateful if anyone could ask for a professor who is familiar with it.
wbCapture.Navigate (StrUrl);
Then set the URL and
At the DocumentCompleted event
Bitmap bmp = new Bitmap (wbCapture.Width, wbCapture.Height);
So, I'm doing some processing of capturing the screen in a loop, but for some reason, it may or may not work.
There are two patterns that don't work, one is that the DocumentCompleted event is fired,
There are patterns that cannot be captured because is null, and patterns that the DocumentCompleted event does not occur no matter how long you wait.
When you monitor
wbCapture.IsBusy = True
wbCapture.ReadyState = Loading
wbCapture.IsBusy = True
wbCapture.ReadyState = Interactive
For the pattern that changes to, the DocumentCompleted event is fired for the time being, but Document.Body may be Null.
The other is immediately after monitoring
wbCapture.IsBusy = False
wbCapture.ReadyState = Loading
It is a pattern of.
In this case, the DocumentCompleted event will not fire no matter how long you wait.
Why is this happening?
  • Answer # 1

    How about monitoringandin a background worker thread?
    I don't know how it is now, but you know that webbrowser control is not always the latest IE installed.
    Get inner html by regular monitoring, search for closing tags of body and html, wait for documentcomplete if found, if it does not come even after waiting for 5 seconds, cancel the documentcomplete event handler and execute the event method.
    If javascript is very heavy, there are too many tags and drawing delays occur, or there are a lot of nice content additions in javascript, the screen remains blank even when the documentcomplete notification comes. Is it possible?