Results 1 to 2 of 2

Thread: Check for element or keep trying until element is found???

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2012
    Location
    United Kingdom
    Posts
    20

    Unhappy Check for element or keep trying until element is found???

    Hey I have been doing well and also I am a noob I know it and you know it a lot has started making sense and I am evening figuring new things out without using Google but of course I have hit another snag in my program so here goes

    I am waiting for an email to arrive (the page automatically refreshes) and then I want to click the link (I do not need to click to open the email or anything like that) I also have the code to click and navigate to the address reason being it was the only way I could figure out how to stop it opening in a new window on IE

    So my only problem is I need a way to check every x seconds for the element and then if its there proceed with my code and if its not wait and then check again or however this is done in VB

    If this is not the way its done please point me in the right direction the code I am using to find and then navigate to the link is

    Code:
    Dim emailpageelements As HtmlElementCollection = WebBrowser2.Document.GetElementsByTagName("a")
    
                For Each emailver As HtmlElement In emailpageelements
    
                    If InStr(emailver.InnerHtml, "https://twitter.com/account/confirm_email/") Then
                        WebBrowser1.Navigate(emailver.InnerText)
                    End If
    
                    Try
    
                    Catch ex As Exception
    
                    End Try

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jan 2012
    Location
    United Kingdom
    Posts
    20

    Re: Check for element or keep trying until element is found???

    I may be wrong but am I right in thinking I need to check if the variable contains anything?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width