Jump to content

_IELinkGetCollection


 Share

Recommended Posts

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

  • Moderators

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
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...