HTML viewer events

I feel really stupid but the only event that I can see is the ‘statuschanged’ event. However according to the documentation there are many more events. I am particularly interested in the DocumentComplete event so that I can copy the contents of the HTMLviewer into a variable for further use. (I now use a timer but using a fixed delay is not correct because loading times may differ each time). So my question is how can I use the document complete event while the only event in the XOJO programming environment is status changed event.

A second issue is that I want to load the same URL repeatedly in some loop. Of course I need to wait after the HTMLviewer.LoadURL method. But anything that I do to implement that wait, for instance checking a global variable that I change when the timer is fired is preventing the download. What I really need is a routine that waits for specific time but has background processes like downloading not interupted.

Which version of Xojo ?

Are you creating a program for Mac ? Windows ? Linux ? iOS ?

select HTMLViewer on the left, then

Menu -> Insert -> Event Handler

Thanks, this is really working well much better than using a timer.

By calling a new loadurl in the documentcomplete handler I can download the docs at maximum speed.

HTTPSocket would be faster for downloading a large amount of documents.
Depending on who you’re scraping they may not like you pulling information from their site in such a way.