novblog Posted July 12, 2011 Share Posted July 12, 2011 (edited) Hello, i have problem with detecting a special link from a link collection, here is the HTML code <a href="http://mysite.com?act=1" onclick="javascript:alert(1)"></a> <a href="http://mysite.com?act=2" onclick="javascript:alert(2)"></a> My aim is trying to click on the link with the onclick="javascript:alert(2)", and here is autoit code : $oIE = _IECreate ("http://mysite.com") $oLinks = _IELinkGetCollection ($oIE) For $oLink In $oLinks if StringInStr($oLink.href,"mysite.com") and $oLink.onclick<>"javascript:reloadpage(2)" Then _ArrayAdd($Array,$oLink.href);// this add nothing to the array list which there was something wrong with _IELinkGetCollection EndIf Next Thanks for help ! Edited July 12, 2011 by novblog Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 12, 2011 Share Posted July 12, 2011 That doesn't make any sense. You want to click on 'onclick="javascript:alert(2)"', but your matching condition is '$oLink.onclick<>"javascript:reloadpage(2)"'. What was the point again? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
novblog Posted July 13, 2011 Author Share Posted July 13, 2011 That doesn't make any sense. You want to click on 'onclick="javascript:alert(2)"', but your matching condition is '$oLink.onclick<>"javascript:reloadpage(2)"'. What was the point again?i'm sorry for the typo. but luckily i solve the problemthanks for reading this. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now