George__

Refresh Webpage Until True

5 posts in this topic

While $count = 0
               For $i = 0 To UBound($asLink)-1
                  _IELoadWait($oIE)
                  If StringInStr($asLink[$i][1], $sSearch1) And StringInStr($asLink[$i][1], $sSearch1) Then
                     _IENavigate($oIE, $asLink[$i][0])
                     _IELoadWait($oIE)
                     $count = $count + 1
                     ExitLoop
                  Else
                     Send ("{F5}")
                     _IELoadWait($oIE)
                  EndIf
               Next
            WEnd

Everything works with out the loop there is more code but this seems to be whats wrong but basically it will keep constantly refreshing the page however wont find the link until its like 20th refresh and that varies however i want it to go to the link a soon as it is there however it is clearly there but does not find it. Also if there a way to detect a new text to be added to the page. Any help would be much appreciated:)

Share this post


Link to post
Share on other sites



they are all in line it just moved the first one 

 

Share this post


Link to post
Share on other sites

Any ideas?

 

Share this post


Link to post
Share on other sites

Your code is incomplete, so it is difficult to make any suggestions. Where do $asLink and $sSearch1 get their values? Shouldn't these be updated each time the page gets refreshed?

Instead of using Send, you could try

_IEAction($oIE, 'refresh')

 

1 person likes this

Share this post


Link to post
Share on other sites

Thanks i will try that, I was trying it first on something that was always there however it would not find it when it refreshed however when the refresh code was not there it found it. It was almost as if it was refreshing to fast before the webpage was fully searched what i didn't understand with the use of the if else statement

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now