Jump to content

IE.au3 - While This Link Exists


 Share

Recommended Posts

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 webpage

2) Grab data from webpage

3) Click "Next"

4) Grab data from the new (Next) webpage

5) 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 by litlmike
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...