I have a web scraping application.
This app uses Interop.SHDocVw.dll reference to create an instance of Internet Explorer. In order to navigate to the sites in which I need to retrieve data from.
However my loading process is rather simplistic because I honestly cannot figure out another more effective way to read when the page loads.
I have a function that simply waits to see if the document has been loaded
Dim xDocLoaded as Boolean = false
Dim wait as Integer = 15
Dim start as DateTime
Dim xMatchURL, xMatchURL2 as string
xMatchURL = "www.google.com"
xMatchURL2 = "www.google.com"
Do Until xDocLoaded
Application.DoEvents()
Threading.Thread.Sleep(100)
If start.AddSeconds(wait) < Now Then
result = False
Exit Do
End If
Loop
if xMatchURL = xMatchURL2 Then
return True
else
return False
end if
Is there anyway to read the Internet Explorer load / status bar to tell when the page has completed loading?
This app uses Interop.SHDocVw.dll reference to create an instance of Internet Explorer. In order to navigate to the sites in which I need to retrieve data from.
However my loading process is rather simplistic because I honestly cannot figure out another more effective way to read when the page loads.
I have a function that simply waits to see if the document has been loaded
Dim xDocLoaded as Boolean = false
Dim wait as Integer = 15
Dim start as DateTime
Dim xMatchURL, xMatchURL2 as string
xMatchURL = "www.google.com"
xMatchURL2 = "www.google.com"
Do Until xDocLoaded
Application.DoEvents()
Threading.Thread.Sleep(100)
If start.AddSeconds(wait) < Now Then
result = False
Exit Do
End If
Loop
if xMatchURL = xMatchURL2 Then
return True
else
return False
end if
Is there anyway to read the Internet Explorer load / status bar to tell when the page has completed loading?
Last edited: