查看下AUTOIT帮助文档吧. 这些函数都有详细解释及示例.
Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended ;获取框架的总数.
$oFrame = _IEFrameGetCollection($oIE, $i) ;按顺序获取框架对象
;成功后, oFrame会是个对象变量,不能直接显示出它的"数值".#include <IE.au3>
#include <MsgBoxConstants.au3>
$oIE = _IECreate('http://mail.126.com/')
If Not IsObj($oIE) Then Exit MsgBox(16, 'Err', '无法创建IE对象')
Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended ;这里@extended是什么意思,后面 $iNumFrames怎么就显示3了呢
Local $sTxt = $iNumFrames & " 个框架 found" & @CRLF & @CRLF
MsgBox(64,"提示",'找到' & $iNumFrames & '个框架')
Local $oFrame = 0, $sTxt = ''
For $i = 0 To ($iNumFrames - 1)
$oFrame = _IEFrameGetCollection($oIE, $i)
; MsgBox(64,"提示",$oFrame) ;可以成功进入循环,但这里$oFrame得不到值
$sTxt = $sTxt & _IEPropertyGet($oFrame, "innertext") & @CRLF
;MsgBox(64,"提示","执行到这了");上一句挂起了,死活不往下执行了,这句执行不到
Next
MsgBox($MB_SYSTEMMODAL, "所有框架的文本", $sTxt)
_IEQuit($oIE)
|