Sign in to follow this  
Followers 0
litlmike

IE.au3 - While This Link Exists

5 posts in this topic

#1 ·  Posted (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 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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

At least you explained yourself and provided some code that in turn got you an answer.

Your Welcome!

Edited by big_daddy

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
Sign in to follow this  
Followers 0