Jump to content

Problem with _IELinkGetCollection


Recommended Posts

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
Link to comment
Share on other sites

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

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...