Jump to content
Sign in to follow this  

Set Object Property As Variable

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

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

Share this post

Link to post
Share on other sites

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

Edit : typos

Edited by mikell
  • Like 1

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.