$aArray = _IEFrameGetCollection($ObjIE)
$max = @extended
ConsoleWrite("Array Length: " & $max & @CR)
For $item in $aArray
ConsoleWrite("Value" & $item.src)
Next
代码导致以下错误:
- >在ITSM-GUI-Automation.au3中遇到COM错误
----> $ IEComErrorScriptline = 106
----> $ IEComErrorNumberHex = 80020003
----> $ IEComErrorNumber = -2147352573
----> $ IEComErrorWinDescription =找不到会员。
----> $ IEComErrorDescription =
----> $ IEComErrorSource =
----> $ IEComErrorHelpFile =
----> $ IEComErrorHelpContext = 0
----> $ IEComErrorLastDllError = 0
奇怪的是,$ max被设置为3但是它找不到iframe。怎么能找到它并立即找不到它?
答案 0 :(得分:1)
这是因为我对Autoit对象缺乏了解。这不会返回一个对象数组,而是一个必须通过不同方式访问的集合。
希望这有助于其他人。
$collection = _IEFrameGetCollection($ObjIE)
$max = @extended
ConsoleWrite("Array Length: " & $max & @CR)
For $item = 0 to $max - 1
$obj = IEFrameGetCollection($ObjIE, $item)
ConsoleWrite("Value" & $item.src)
Next
答案 1 :(得分:0)
#include <IE.au3>
Local $oIE = _IE_Example("frameset")
Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
For $i = 0 To ($iNumFrames - 1)
Local $oFrame = _IEFrameGetCollection($oIE, $i)
$FrameHTML = _IEDocReadHTML($oFrame); or
$FrameHTML = _IEPropertyGet($oFrame, "innerhtml"); or
$FrameHTML = _IEPropertyGet($oFrame, "outerhtml")
ConsoleWrite($FrameHTML & @LF)
Next