Questions › I want to use an online website using my application

I have an application which deals with the website

For the "Or Paste CSS:" text I add text with the element id

WebBrowser1.Document.GetElementById("css_data").InnerText = TextBox1.Text

And to click the "Flip the CSS" button I use the code


But for the results or "generated" text, I cannot get it back to my application because it doesn't have an id.

The HTML inspector only has

<textarea class="form-control" name="css_data" rows="10" dir="LTR">

I want to bring the generated text back to another text box.

Comments :
bdn02 replied

Try to use webBrowser1.Document.GetElementsByTagName("textarea")

not working, error "Value of type 'System.Windows.Forms.HtmlElementCollection' cannot be converted to 'String' "

and also i want to get the text from the class which have only the (dir="LTR") string

1 Answers :
Ahmed Barayez answered

after some searching and editing i found it

For Each h As HtmlElement In WebBrowser1.Document.GetElementsByTagName("textarea")
            If Not Object.ReferenceEquals(h.GetAttribute("dir"), Nothing) AndAlso h.GetAttribute("dir").Equals("LTR") Then
                TextBox2.Text = h.InnerText
                Exit For
            End If