C
Curtis
I am trying to debug my application which is a web scrapping application. I randomly get error will my code is processing web pages. For example I get this error:
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in
WebClient.exe
Additional information: Exception from HRESULT: 0xC0000005.
I am using HttpWebReponse/Request to retrieve html documents so I load them into an IhtmlDocument2 by using the following declaration and then code:
Dim myDoc As mshtml.IHTMLDocument2 = New mshtml.HTMLDocument
myDoc.close()
myDoc.open("about:blank")
'write the HTML to the document using the MSHTML "write" method...
Dim clsHTML() As Object = {pHTML}
myDoc.write(clsHTML)
clsHTML = Nothing
It has been previously suggested that processing shouldn't continue with the document until it is completely loaded. I know the status of an IhtmlDocument2 can be obtained by viewing the ..IHTMLDocument2.readyState. When I view my code through the debugger the ready state changes from loading to interactive after I write content to the html but it never changes to complete. Does anyone know why this would be and what I should add to my code to fix this problem.
Thank you in advance,
Curtis
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in
WebClient.exe
Additional information: Exception from HRESULT: 0xC0000005.
I am using HttpWebReponse/Request to retrieve html documents so I load them into an IhtmlDocument2 by using the following declaration and then code:
Dim myDoc As mshtml.IHTMLDocument2 = New mshtml.HTMLDocument
myDoc.close()
myDoc.open("about:blank")
'write the HTML to the document using the MSHTML "write" method...
Dim clsHTML() As Object = {pHTML}
myDoc.write(clsHTML)
clsHTML = Nothing
It has been previously suggested that processing shouldn't continue with the document until it is completely loaded. I know the status of an IhtmlDocument2 can be obtained by viewing the ..IHTMLDocument2.readyState. When I view my code through the debugger the ready state changes from loading to interactive after I write content to the html but it never changes to complete. Does anyone know why this would be and what I should add to my code to fix this problem.
Thank you in advance,
Curtis