如何在Webbrowser上从此HTML获取文本? [VB.NET]

问题描述

我正在尝试解析此HTML代码

<textarea id="1" name="padText" class="col-xs-12 text-tab-1" style="min-height: 400px; height: 493px;">TEXT</textarea>

我正在尝试使用许多代码。 这是其中之一:

 Dim MailElement As HtmlElement = Webbrowser2.Document.GetElementById("1")

    If MailElement IsNot nothing Then 'Necessary check: Was the element found?
        RichTextBox1.Text = MailElement.GetAttribute("value")
    End If
End Sub

但是不幸的是它没有用。 我也尝试解析textarea ID,但是它给了我一个简单的“ 0”。

谢谢

解决方法

我自己找到了解决方法。

WebBrowser1.Document.All("padText").GetAttribute("value")