Does anyone have sample code in
VB.NET that demonstrates how to get to the innertext from a webpage like the Internet control did in VB6? I can't seem to get this to work:
' After creating a reference to the Microsoft Internet Controls library 1.1
Imports SHDocVw
WithEvents MyBrowser As New SHDocVw.InternetExplorerClass()
' Inside some click event
MyBrowser.Navigate("www.someurl.com/home.html")
' After document completely loads.
Private Sub MyBrowser_DocumentComplete(ByVal pDisp As Object, ByRef URL As Object) Handles MyBrowser.DocumentComplete
Dim strFileName = Directory.GetCurrentDirectory & "\temp\download.txt"
Dim fs As New FileStream(strFileName, FileMode.OpenOrCreate)
Dim sw As New StreamWriter(fs)
MsgBox("Got HTML")
sw.WriteLine("Document Complete")
sw.Close()
MyBrowser.Quit()
MyBrowser = Nothing
End Sub
The object interface does not support the OpenURL method and innertext properties that the VB6 control supported. While debugging, I can see the iinertext property that contains the text I want, but no way to get to it!