Finding WebBrowser Element With No ID

Posts 1–14 of 14 · Page 1 of 1
Finding WebBrowser Element With No ID
Ok so I created a way to automatically create a yopmail, but once its created I need to grab the email high lighted in red and put it in a textbox is there a way of doing this?




Thanks
Dunno, use REGEX, to match that div. And retrieve it.
Quote Originally Posted by 'Bruno View Post
Dunno, use REGEX, to match that div. And retrieve it.
I don't know what REGEX is, can you direct me to more info
What's your skype. I could do it but goes faster if we have direct contact
Quote Originally Posted by hustelboy View Post
What's your skype. I could do it but goes faster if we have direct contact
I sent you a pm
Got it right here sir !

Code:
  For Each h As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
            If Not Object.ReferenceEquals(h.GetAttribute("className"), Nothing) AndAlso h.GetAttribute("className").Equals("bname b al_l") Then
                TextBox1.Text = h.InnerText
                Exit For
            End If
        Next
Was kinda searching in the begin, but then it worked
Quote Originally Posted by hustelboy View Post
Got it right here sir !

Code:
  For Each h As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
            If Not Object.ReferenceEquals(h.GetAttribute("className"), Nothing) AndAlso h.GetAttribute("className").Equals("bname b al_l") Then
                TextBox1.Text = h.InnerText
                Exit For
            End If
        Next
Was kinda searching in the begin, but then it worked
Worked great thanks for your help last piece of the puzzle, im trying to get my creator to detect and click a text hyperlink.

Quote Originally Posted by silentrunner2 View Post
Worked great thanks for your help last piece of the puzzle, im trying to get my creator to detect and click a text hyperlink.

Since you are using a webbrowser just tell the browser to browse/go to the link that you get there... whats difficult on that?
To get the link just change the last code.. shouldnt be hard..
(This is why spoonfeeding is bad)
Quote Originally Posted by 'Bruno View Post


Since you are using a webbrowser just tell the browser to browse/go to the link that you get there... whats difficult on that?
To get the link just change the last code.. shouldnt be hard..
(This is why spoonfeeding is bad)
?? Im not just asking without trying, I already tryed some other ways such as below, if you mean find the plain text and make the browser navigate to that I don't know how to search for it, it changes everytime. The code im using below should be working I don't know why its not.

Code:
    Private Sub Button7_Click_2(sender As System.Object, e As System.EventArgs) Handles Button7.Click
        theElementCollection = WebBrowser2.Document.GetElementsByTagName("a")

        For Each curElement As HtmlElement In theElementCollection

            ctrlIdentity = curElement.GetAttribute("a").ToString

            If ctrlIdentity = "Click Here" Then

                curElement.InvokeMember("click")

            End If

        Next
    End Sub
Still need some help on this, tried multiple methods. Even tryed doing some sendkeys to get the browser to highlight the hyperlink and press enter to browse to it but no luck
There must be a method of doing this, anyone? I have looked at multiple threads and tuts but just can't seem to click that hyperlink. I have also looked for methods of copying the text and just making the browser navigate to it but i think the email is in some kinda of java or flash window??
Code:
For Each curElement As HtmlElement In WebBrowser2.Document.GetElementsByTagName("a")
    If curElement.InnerText = "Click Here" Then
        WebBrowser2.Navigate(curElement.GetAttribute("href"))
    End If
Next
Tried that?
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us