none
webbrowser get attribute RRS feed

  • Question

  • hey guys ,

    how i can get the value of sLV="" attribute that in <script> tag name into textbox1 using button1

    Friday, February 24, 2017 2:38 AM

Answers

  • FIXED with

    Dim pairs() As String = {TextBox4.Text}
            For Each pair In pairs
                Dim position As Integer = pair.IndexOf("sVL=")

                TextBox5.Text = pair.Substring(position, 117)

             
            Next

    • Marked as answer by Ziad Hosary Friday, February 24, 2017 5:47 PM
    Friday, February 24, 2017 5:47 PM

All replies

  • Hi Ziad Hosary,

    Thank you for posting in MSDN forum.

    Based on your description, it seems that you'd like to call the JavaScript from WebBrowser control.

    Maybe the following code snippet will be helpful to you:

    WebBrowser1.Document.Window.DomWindow.execscript("text/JavaScript")
    Dim page As String = WebBrowser1.Document.Body.InnerHtml   
    TextBox1.Text = page

    Best Regards,

    Neda Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 24, 2017 6:43 AM
    Moderator
  • hi,

    i used this code to get every innerhtml in scrript nametag.. into textbox4.text

    Dim PageEleme As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("script")
            For Each CurEle As HtmlElement In PageEleme
                TextBox4.Text = TextBox4.Text & CurEle.GetAttribute("innerHtml") & Environment.NewLine
            Next

    so what im tring to wright a code to search for me the attribute named sVL="" and set the value of it into textbox5

    Friday, February 24, 2017 1:54 PM
  • maybe its called : Substring textbox ? where sVL=""
    Friday, February 24, 2017 4:45 PM
  • FIXED with

    Dim pairs() As String = {TextBox4.Text}
            For Each pair In pairs
                Dim position As Integer = pair.IndexOf("sVL=")

                TextBox5.Text = pair.Substring(position, 117)

             
            Next

    • Marked as answer by Ziad Hosary Friday, February 24, 2017 5:47 PM
    Friday, February 24, 2017 5:47 PM