litlmike Posted December 7, 2006 Share Posted December 7, 2006 (edited) I am trying to run a function While a Link with the Text "Next" exists, and completes 1 more time when that Link does not exists. The script should run so long as a there is a Link titled "Next" on the page, plus 1 more revolution.Scenario:1) Go to a webpage2) Grab data from webpage3) Click "Next"4) Grab data from the new (Next) webpage5) The last page to grab data from will not have the Link "Next", the loop should run one more time.Code I have so far:While _IELinkClickByText ($oIE, "Next") = -1 Get_Keywords() _IELinkClickByText ($oIE, "Next") WEnd Edited December 7, 2006 by litlmike _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted December 7, 2006 Moderators Share Posted December 7, 2006 Would this not work? While Not @error Get_Keywords() _IELinkClickByText ($oIE, "Next") WEnd Link to comment Share on other sites More sharing options...
litlmike Posted December 7, 2006 Author Share Posted December 7, 2006 Would this not work? While Not @error Get_Keywords() _IELinkClickByText ($oIE, "Next") WEnd I like the approach, and it does get me past the needing one extra revolution, however it continually loops. Every time it loops on the last page, Scite produces this error, which makes no sense to me why the loop does not exit. --> IE.au3 Warning from function _IELinkClickByText, $_IEStatus_NoMatch _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
litlmike Posted December 7, 2006 Author Share Posted December 7, 2006 Correction! You were right the first time, I just noticed a typo. This is why you are the AutoIt MVP, and I am the struggling learner. Thanks big_daddy! _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted December 7, 2006 Moderators Share Posted December 7, 2006 (edited) At least you explained yourself and provided some code that in turn got you an answer. Your Welcome! Edited December 7, 2006 by big_daddy 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