Jump to content

Set Object Property As Variable


AFC
 Share

Go to solution Solved by mikell,

Recommended Posts

How can I pass objects property as variable like this ? 

$object = "span"
$property = "innertext"
$search = "Videolar "
$oButton = _objectAra($oIE, $object, $property, $search)
_IEAction($oButton, "click")


Func _objectAra($oIE, $object, $property, $search)
    $oButtons = _IETagNameGetCollection($oIE, $object)
    For $oButton In $oButtons                           
        If $oButton.$property == $search Then 
        Return $oButton
        EndIf
    Next
EndFunc

I just want to use something like $oButton.$property instead of $oButton.innertext

I found a topic like this but I couldn't find/understand solution there '?do=embed' frameborder='0' data-embedContent>>

Edited by AFC
Link to comment
Share on other sites

  • Solution

The answer is in the link you pointed to

#include <IE.au3>

$oIE = _IE_Example("basic")
$property = "id"
$property2 = "innertext"
$oDivs = _IETagNameGetCollection($oIE, "div")
For $oDiv In $oDivs                           
     If Execute("$oDiv." & $property) == "line1" Then Msgbox(0,"", Execute("$oDiv." & $property2))
Next

Edit : typos

Edited by mikell
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...