Sign in to follow this  
Followers 0
litlmike

_IELinkGetCollection

4 posts in this topic

I need to test is a page has the link titled "Next". Can I use _IELinkGetCollection to do that? I am not testing for the URL, just the title of the link.

Or is there some crazy way to use _IELinkClickByText that does not have to click on the link first, to test if it exists?

Thanks in Advance.

Share this post


Link to post
Share on other sites



Thanks!

Wow big_daddy, that 6 lines of code created so many more questions for me. But first thing first, lets figure this out. Why does this slight modification always show up true, when the .outerText "Next" is not on the page?

#include <IE.au3>
$oIE = _IE_Example ("basic")
$oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    If $oLink.outerText = "Next" Then
        $fMatch = True
        MsgBox(4096, "Success", "Dance!", 3)
    EndIf
Next

Share this post


Link to post
Share on other sites

If the links text is null (i.e. the image) then the .outerText Method will return 0 (zero). With that in mind if you compare a number to a string it always returns true. The simple fix is to change the return value into a string before comparing.

#include <IE.au3>
$oIE = _IE_Example ("basic")
$oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    If String($oLink.outerText) = "Next" Then
        $fMatch = True
        MsgBox(4096, "Success", "Dance!", 3)
    EndIf
Next

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  
Followers 0