简体   繁体   中英

How to get text from this Html on webbrowser? [VB.NET]

I'm trying to parse this HTML code:

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

And I'm trying to use many codes. This one is one of them :

 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

But unfortunately is not working. I've tried to parse the textarea ID too, but it gives me back a simple "0".

Thanks

我自己找到了解决方案。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM