Sign in to follow this  
Followers 0
ckelsoe

Getting info on nested frames and framesets?

4 posts in this topic

Does anyone know how to get this code to get info on nested iframes? Basically iFrames within iFrames and framesets?

Func _TestForFrames()
    _DebugSetup("Frames Check")

    Local $URL = $MainURL
    Local $oIE = _IECreate($URL, 1, 1, 1, 1)
    Local $oFrames = _IEFrameGetCollection($oIE)
    Local $iNumFrames = @extended
    For $i = 0 To ($iNumFrames - 1)
        Local $oFrame = _IEFrameGetCollection($oIE, $i)
        MsgBox(0, "Frame Info", _IEPropertyGet($oFrame, "locationurl"))
        _DebugOut(_IEPropertyGet($oFrame, "locationurl"))

    Next

EndFunc   ;==>_TestForFrames

Also - can the _IEPropertyGet return the frame name instead of the locationurl? I looked but did not see that option in ie.au3.

Share this post


Link to post
Share on other sites



Once you have an object reference, you should be able to just check the value of $oFrame.name.

Also, if you know the name of the iframe, you could use _IEFrameGetObjByName instead of looping through all of the iframes.

Share this post


Link to post
Share on other sites

Hi DanP2 - using the _IEFrameGetObjectByName has issues because some of the frames do not have a name. They do have an ID. I tried _IEGetObjectByID which also did not seem to work. I do not know if I have to get the frameset object first to get to the frame or why I could not just get to the frame by it's ID. 

My goal with the code in the first post was to see what AutoIt sees when looking at the page for the frames and framesets. 

Share this post


Link to post
Share on other sites

Perhaps >this UDF will help you out.

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