Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27494

HTML Element problems

$
0
0
Hello all,
I am currently working on a new project that requires me to automate part of my gmail account. The problem i am having is opening up a recieved email.
What i need to happen is have the program log into my account and then go through my emails and click on activation links. The only thing is i cannot seem to get into my emails with automation. They do not have an id and every other htmlelement property that i try just seems to fail. i will post some of the webpage code and some of my code. If you need more information just ask.


HTML Code:

<td id=":os" tabindex="0" role="link" class="xY "><div class="xS"><div class="xT"><div class="y6"><span id=":oq">Click link to post! sdfa...</span><span class="y2">&nbsp;<span dir="ltr">-</span>&nbsp;Hey, thanks for posting with us! You must click the following link to make your posting live (you can</span></div></div></div></td>

Code:

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("span")
        For Each curElement As HtmlElement In theElementCollection
            Dim controlName As String = curElement.GetAttribute("email")
            If controlName = "support@backpage.com" Then
                curElement.InvokeMember("click")
            End If

        Next


    End Sub



basically i just need a way to find the element and activate the link to open the email.

Viewing all articles
Browse latest Browse all 27494

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>