qwer

Can't find frames within a frameset in Internet Explorer

2 posts in this topic

Hi,

I can't find any frame on an internal website.

The website code looks like this:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<HTML>
  <HEAD>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">

      <style type="text/css">
      <!--
        ......
        -->
        </style>


    <title>
      .........
    </title>

  </HEAD>
  <frameset rows="68, *">
    <frame frameborder="0" src="header.htm" name="frm_header" scrolling="NO" NORESIZE>
    <frame frameborder="0" src="content.do" name="frm_main">
  </frameset>
</HTML>

The website requires login credentials, is that the problem?

 

I'm trying the default example to load a frameset from here: https://www.autoitscript.com/autoit3/docs/libfunctions/_IEIsFrameSet.htm with additional waiting and errorhandler functions from here:

#include <IE.au3>
#include <MsgBoxConstants.au3>
#include <Timers.au3>

_IEErrorHandlerRegister(_User_ErrFunc)


_countFrames()

Func _countFrames()
Local $oIE = _IECreate("http://foo.bar.net:8000/sap(fooooooooooooo==)/foo/bar/bla/baz/default.htm")
Local $hStarttime = _Timer_Init()
_IELoadWait($oIE)
_IELoadWait_ForAllFrames($oIE)
Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
If $iNumFrames > 0 Then
    If _IEIsFrameSet($oIE) Then
        MsgBox($MB_SYSTEMMODAL, "Frame Info", "Page contains " & $iNumFrames & " frames in a FrameSet")
    Else
        MsgBox($MB_SYSTEMMODAL, "Frame Info", "Page contains " & $iNumFrames & " iFrames")
    EndIf
Else
    MsgBox($MB_SYSTEMMODAL, "Frame Info", "Page contains no frames")
EndIf

_IEQuit($oIE)
EndFunc



Func _IELoadWait_ForAllFrames(ByRef $oObject, $iDelay = 0, $iTimeout = Default)
    _IELoadWait($oObject, $iDelay, $iTimeout)
    If @error Then Return SetError(@error, @extended, -1)

    Local $oFrames_coll = _IEFrameGetCollection($oObject)
    #forceref $oFrames_coll
    Local $iNumFrames = @extended
    Local $oFrame = Null
    For $iFrame_idx = 0 To ($iNumFrames - 1)
        $oFrame = _IEFrameGetCollection($oObject, $iFrame_idx)
        _IEDocGetObj($oFrame)
        If Not @error Then
            _IELoadWait($oFrame, $iDelay, $iTimeout)
            If @error Then Return SetError(@error, @extended, -1)
        EndIf
    Next

    Return SetError($_IESTATUS_Success, 0, 1)

EndFunc   ;==>_IELoadWait_ForAllFrames


; User's COM error function.
Func _User_ErrFunc($oError)
    ; Do anything here.
    ConsoleWrite(@ScriptFullPath & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
            @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _
            @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
            @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _
            @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _
            @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
            @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
            @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
            @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
            @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF)
EndFunc   ;==>_User_ErrFunc

The script displays: Page contains no frames

But I expect two frames to be found.

Share this post


Link to post
Share on other sites



In the above example the console displays:

--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147417848, Browser has been deleted prior to operation.)
--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType ()
--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType ()

...

err.number is:   0x80010108

...

 

if I run:

Local $oIE = _IE_Example("frameset")

everything is ok.

if I paste the html code from the example Local $oIE = _IE_Example("frameset") into another html file it doesn't work:

Spoiler
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>_IE_Example("frameset")</title>
</head>
<frameset rows="25,200">
    <frame name=Top SRC=about:blank>
    <frameset cols="100,500">
        <frame name=Menu SRC=about:blank>
        <frame name=Main SRC=about:blank>
    </frameset>
</frameset>
</html>

 

_IECreate("C:\autoit\framesetexample.html")

then the error in the console is again the same:

 

--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147417848, Browser has been deleted prior to operation.)
--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType ()
--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType ()

...

err.number is:   0x80010108

...

 

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