Results 1 to 3 of 3

Thread: Repeat Loop/Code Check for Text,URL etc

  1. #1

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

    Repeat Loop/Code Check for Text,URL etc

    I am waiting for a confirmation email to arrive within the web browser I am using I do not need to click any buttons to open this mail I just need some help figuring out how I can check whether it has arrived or not

    I already have the code to find the link and navigate to it (I had to navigate rather then invoke due to it trying to open in a new window outside of web browser and out of my control)

    How can I keep checking for my specified element and when found carry out the rest of my code or is there another way I should be doing this the code I am using to find the verification link and navigate to it is as follows

    Code:
    Dim emailpageelements1 As HtmlElementCollection = WebBrowser2.Document.GetElementsByTagName("a")
    
            For Each emailver1 As HtmlElement In emailpageelements1
    
                If InStr(emailver1.InnerHtml, "https://twitter.com/account/confirm_email/") Then
    
                    WebBrowser2.Navigate(emailver1.InnerText)
                End If
            Next
    I am looking for anyway to keep checking for this tag name/element until it is found and then navigate to it.

    I really am desperate for help on this one I have been reading about loops but cannot seem to find any example which I can use and change to my needs I have done so well in learning up until now and I have really hit a brick wall for something which seems so simple

  2. #2

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

    Re: Repeat Loop/Code Check for Text,URL etc

    I keep coming back to posts which say I can loop until but I am unable to figure out how to loop until my element has been found and then proceed to navigate if possible

  3. #3
    Fanatic Member proneal's Avatar
    Join Date
    May 2011
    Posts
    762

    Re: Repeat Loop/Code Check for Text,URL etc

    I don't know how this code is working for you but if you are looking to get out of the For/Next loop you have there, just insert Exit For under the navigate statement

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