Sign in to follow this  
Followers 0
AFC

Set Object Property As Variable

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Have you looked at _IEPropertyGet?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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
1 person likes this

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