Jump to content
Sign in to follow this  

$oImg.nameProp - is there a way to get the outerhtml?

Recommended Posts


$oIE = _IECreate ("http://www.autoitscript.com/")

$oImg = _IEImgGetCollection ($oIE, 5)

$sInfo = "Src: " & $oImg.src & @CR

$sInfo &= "FileName: " & $oImg.nameProp & @CR

$sInfo &= "Height: " & $oImg.height & @CR

$sInfo &= "Width: " & $oImg.width & @CR

$sInfo &= "Border: " & $oImg.border

MsgBox(0, "4th Image Info", $sInfo)

in examples allows me to get the properties, but can I get the outerhtml? and if so can I use that to click specific buttons?

For instance - the crude code below allows me to click on the button source "expand_btn.gif"

I thought that if I had 4 buttons like this then it would click all 4 in succession - wrong. It clicks the first one 4 times!?

Each button has unique outhtml values e.g. "<IMG onmouseover="this.style.cursor='hand';" onclick="javascript:toggleVisibility('CourseOfferingDefautlsDiv')" src="/mvi/sis_common/stylesets/tafensw/icons/expand_btn.gif">" with the unique bit BOLD

Do I have to get a new collection for each unique outerhtml? or is there a way to click on the button with the unique outerhtml? Could the outerhtml be defined using a regular expression?

$sMyString = "expand_btn.gif"
$oImgs = _IEImgGetCollection ($oIE)
$iNumImg = @extended
For $oImg In $oImgs
    $imagealt=_IEPropertyGet($oImg, "file name")
    If StringInStr($oImg.nameProp, $sMyString) then
        MsgBox(0, "file name" & $imagealt, "file name = " & $oImg.nameProp)
        _IEAction($oImg, "click")

Share this post

Link to post
Share on other sites

From what I understand something like _IEPropertyGet($oObject, "outerhtml") might give you what you need.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

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