Results 1 to 2 of 2

Thread: Loop Troubles

Threaded View

  1. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: Loop Troubles

    For Each requires a Next at the other end

    If I understand correctly what you are trying to do you need to move the Do and the Sleep above the For Each and add a Next before the Loop. You may also want to put an Exit For in there when you find your match.

    Code:
    Dim emailpageelements As HtmlElementCollection = WebBrowser2.Document.GetElementsByTagName("a")
    Dim complete = True
        Do
            System.Threading.Thread.Sleep(6000)
            For Each emailver As HtmlElement In emailpageelements
                 If InStr(emailver.InnerHtml, "https://twitter.com/account/confirm_email/") Then
                     complete = True
                     Exit For
                 End If
            Next
        Loop Until complete
    Last edited by DataMiser; Feb 22nd, 2012 at 08:55 PM.

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