Jump to content
Sign in to follow this  

How to contine clicking by index.. after the first click.

Recommended Posts

I want to click on a link and go do some work.. line in a subroutine... but each time I cause the specific indexed link to click I assume its visiting the site in the same window i am in and is killing my program... is that correct... I tried having the url add a '_NEW' but that did not seem to work... I suppose I could set up a frame and direct the click there but I am not even sure that is the problem....

Bottom line is I can click any link by INDEX, but when I do that thing the program will not move to the next one...

Is there a solution for this.. PLEASE.

Basically I have 30 links on the page and I want to click on every other one... like 12 then 14 and do some work between each one before moving on to the next one... but not working for me..

$oIE = _IECreate(@ScriptDir & '\available_work.htm')
_IELinkClickByIndex($oIE, 12)
_IELinkClickByIndex($oIE, 14)

Share this post

Link to post
Share on other sites

would a possible sollution be to have 2 browsers and do the work in a different browser so as to keep the main one in tact? I am lost.. just pulling at straws... as I need to get this done... its holding me up...

Share this post

Link to post
Share on other sites

Would this be a correct solution : gather all your links in a gui with the ability to run them separately using a ShellExecute ?

Share this post

Link to post
Share on other sites

Thanks for the suggestion, but I solved my own problem.. Wow! I must be learning something with all you folks helping me out... I am getting dangerous...

IF anyone is following and understood the question here is the answer....

1. When autoit did the click the system then navigated to the loop and did the work... so what to do now..

2. Just call for a IE navigate back... lo and behold that loads the page with the clicker stuff again..

3. So whoopee now I can select another button for click...

4. Whoops... another problem.. it all the links have the same name... so what to do now...

5. So I need to remember which link I clicked based on the index so I can increment and click the next one..

6. I have 59 links on the page but the first 9 belong to something else... so at least I know the first one is index 10.

7. Now they were kind enought to tell me on the page the total number of links to expect... as it varies each day..

8. So I noticed that only every other link do I need... in between the link is for some thing else..

So here is the final code below if anyone needs any such jury rig...

Note you do not see the IE command for "Back" as it is on the page that does the work..


;This reads the Accepted Leads.. a total of leads on the page that I need to click.

So it starts at index 10 then increments every other link as the "IE BACK CMD" keeps returning it to the page for a new click.

So bottom line all it does is calculate the number of links to click.. then starts at index 10 and Step 2 makes it click every other link until the calculated number is clickec.

I told you I was getting dangerous... even surprising myself sometime..

Local $sHTML = _IEBodyReadHTML($oIE)

$pos1 = StringInStr($sHTML, '<b>Accepted:') + 13

$pos2 = StringInStr($sHTML, ' ', 0, 1, $pos1)

$tot = StringMid($sHTML, $pos1, $pos2-$pos1)

$tot1 = ($tot*2) + 10 - 2

MsgBox(0,"Orig Number + Start Number + End Number.",$tot & ' 10 ' & $tot1)

for $k = 10 to $tot1 Step 2

MsgBox(0, $k, "Sleep 5 sec", 5)


_IELinkClickByIndex($oIE, $k)




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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...