Jump to content
Sign in to follow this  
continyu

How to click all links in a web page,

Recommended Posts

continyu

Hi there,

I have to click some links in a web page. There are links like this;

www.somesite.com/some.php?99999

I want to click all links start with www.somesite.com/some.php

the number "99999" is the user id's so they are changing every time. How can i click all links without consider about user id'S

(of course there are a lots of links in same page i want to select links only start with www.somesite.com/some.php)

I know a little about ie actions and ie.udf but i don't know how to find this specific links...

Thank you all :blink:

Share this post


Link to post
Share on other sites
StandardUser

Did you try searching the help file? There is very similar example in _IELinkGetCollection function reference. Just parse the link href with string functions

Edited by 871

Share this post


Link to post
Share on other sites
continyu

yep but it is working with link text. i want to work by html link code?

Share this post


Link to post
Share on other sites
continyu

I think your code wasn't working (but i can be mistaken :blink:)

BUT simply this worked when i edited your code;

#include <IE.au3> 
$oIE = _IECreate("http://www.somesite.com/")
$oLinks = _IELinkGetCollection($oIE) 
For $oLink In   $oLinks     
$findlink = StringInStr($oLink.href, "http://www.somesite.com/some.php")    
If $findlink = 0 Then       
Sleep(10)       
Else    _IEAction($oLink, "click")  
MsgBox(0,"OK","Clicked")
    EndIf
    Next

Thank you very much for your help!

I will give your credits if i will be able to finish my script ;):)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.