找回密码
 加入
搜索
查看: 2513|回复: 6

[IE类操作] 关于autoit帮助中框架frame例子的几点提问,请哪个问题指点一下

    [复制链接]
发表于 2017-9-10 13:33:29 | 显示全部楼层 |阅读模式
; Open iFrame example, get a reference to the iFrame
; with a name of "iFrameTwo" and replace its body HTML

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


$oIE = _IECreate('http://mail.126.com/')

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended ;这里@extended是什么意思,后面 $iNumFrames怎么就显示3了呢
Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
Local $oFrame = 0
MsgBox(64,"提示",$iNumFrames)
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, "Frames Info", $sTxt)

_IEQuit($oIE)


;请哪个问题针对以上注释里的问题指导一下,并调试通过。
发表于 2017-9-10 20:07:39 | 显示全部楼层
查看下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)
发表于 2017-9-14 14:49:23 | 显示全部楼层
学习一下,正在查找相关信息。
发表于 2017-9-16 22:25:29 | 显示全部楼层
学习 学习  谢谢
 楼主| 发表于 2017-9-17 10:09:09 | 显示全部楼层
希望高手能多加指点,frame和iframe框架取元素是au3提高的瓶颈,如果往深了研究,一点都不比API调用简单
发表于 2017-10-4 09:41:22 | 显示全部楼层
回复 5# dengpeiyou


        中秋快乐 分享快乐
发表于 2017-10-8 20:39:02 | 显示全部楼层
希望高手能多加指点
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-19 15:38 , Processed in 0.073081 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表