George__ Posted December 8, 2016 Share Posted December 8, 2016 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:) Link to comment Share on other sites More sharing options...
George__ Posted December 8, 2016 Author Share Posted December 8, 2016 they are all in line it just moved the first one Link to comment Share on other sites More sharing options...
George__ Posted December 15, 2016 Author Share Posted December 15, 2016 Any ideas? Link to comment Share on other sites More sharing options...
Danp2 Posted December 15, 2016 Share Posted December 15, 2016 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') George__ 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
George__ Posted December 15, 2016 Author Share Posted December 15, 2016 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now