找回密码
 加入
搜索
查看: 2817|回复: 2

[IE类操作] 求如何取得IE中的三个frame对象进行操作,高手请进

[复制链接]
发表于 2015-1-10 23:16:03 | 显示全部楼层 |阅读模式
本帖最后由 dhlhmgc 于 2015-1-11 13:46 编辑

------- test.html -------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test</title>
</head>
<frameset rows="100,*"  cols="*"  frameborder="no" border="0" framespacing="0">

  <frame src="a.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  
  <frameset cols="180,*" frameborder="no" border="0" framespacing="0">
    <frame src="b.html" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame"  />
    <frame src="c.html" name="mainFrame" id="mainFrame" title="mainFrame" />
  </frameset>
  
</frameset>

<noframes>
        <body></body>
</noframes>
</html>
‘-------------------------------------------------------------
'////////////////
#include <IE.au3>
#include <Debug.au3>
Local $oIE = _IEAttach("test")
if @Error Then
        Local $oIE = _IECreate (@ScriptDir & "\test.html")
Endif
_IELoadWait( $oIE )
Local $oFrame = _IEFrameGetCollection($oIE, 1)    
; 测试 索引 0-无效  1-b.html(Frame对象)  2-c.html(Frame对象) 3-无效
$strHTML = _IEDocReadHTML ($oFrame)
msgbox(48,1,$strHTML)
;  如html中的Name属性由服务器生成(可能会变化)故没有使用_IEFrameGetObjByName ( ByRef $o_object, $s_name ) 来获取,
; 想使用索引查找方式取得, 求如何取得a.html的(Frame对象)
发表于 2015-1-11 05:05:57 | 显示全部楼层
_IEFrameGetCollection($oIE, 1) 索引改成2 、3试试
发表于 2015-1-11 07:05:00 | 显示全部楼层
学习学习。。。。。。。。。。。。。。。。。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-5 16:09 , Processed in 0.077469 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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