Reputation: 77
This code does not work because 'innertext' is not a member of 'System.Windows.Forms.HtmlElementCollection'. Does anyone know what to do? Thanks.
Do While WebBrowser1.ReadyState = WebBrowserReadyState.Complete
Dim body As String = WebBrowser1.Document.GetElementsByTagName("body").innerText
Loop
Upvotes: 2
Views: 4987
Reputation: 89285
You can try using GetElementById
(without 's') instead of GetElementsById
(with 's') :
Dim body As String = WebBrowser1.Document.GetElementByTagName("body").innerText
The former method returns HtmlElement
which has InnerText
property.
Upvotes: 1