continyu 0 Posted July 12, 2010 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 Share this post Link to post Share on other sites
StandardUser 2 Posted July 12, 2010 (edited) 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 July 12, 2010 by 871 Share this post Link to post Share on other sites
continyu 0 Posted July 12, 2010 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
StandardUser 2 Posted July 12, 2010 Try this (not tested) #include <IE.au3> $oIE = _IECreate ("www.somesite.com") $oLinks = _IELinkGetCollection ($oIE) For $oLink In $oLinks If StringInStr($oLink.href, "www.somesite.com/some.php") Then _IEAction($oLink, "click") Next Share this post Link to post Share on other sites
continyu 0 Posted July 12, 2010 I think your code wasn't working (but i can be mistaken ) 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
StandardUser 2 Posted July 12, 2010 Yep, I forgot to check return value of StringInStr, to keep the code more compact, you could do like this #include <IE.au3> $oIE = _IECreate ("www.somesite.com") $oLinks = _IELinkGetCollection ($oIE) For $oLink In $oLinks If StringInStr($oLink.href, "www.somesite.com/some.php")> 0 Then _IEAction($oLink, "click") Next Share this post Link to post Share on other sites