Hi! I have a problem using HTML Document DOM: in the DocumentComplete event handler I'm trying to access DOM elements and I receive an error: no such field. This happens not every time, but sometimes, rarely enough to keep it as it is, but still I would like to understand where the problem is and fix it.
The HTML document might be completed, but not yet ready, for example when it is reloaded while it was not loaded fully yet. You need to check if document's readyState is equal to "complete":
Code
If Items.HTMLDocument.Document.readyState = "complete" Then
// your code
EndIf;