Jump to content
Sign in to follow this  
novblog

Problem with _IELinkGetCollection

Recommended Posts

novblog

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 by novblog

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
novblog

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 problem

thanks for reading this.

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.