找回密码
 加入
搜索
查看: 12879|回复: 9

[IE类操作] iframe框架能不能通过id获得啊?【已解决】

  [复制链接]
发表于 2010-9-2 17:44:41 | 显示全部楼层 |阅读模式
本帖最后由 j88iang 于 2010-9-18 09:40 编辑

代码里没有name。

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

 楼主| 发表于 2010-9-10 19:19:42 | 显示全部楼层
难道就没人能解决吗 大家积极点啊
 楼主| 发表于 2010-9-18 09:37:56 | 显示全部楼层
楼主你的思想太单调了,换个角度吧。
#include <IE.au3>
;前面跳过
$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
For $i = 0 to $iNumForms - 1
$oForm = _IEFrameGetCollection($oIE, $i)
$s2html = _IEDocReadHTML($oForm)
MsgBox(0, "The URL", $s2html)
Next
找到自己需要的框架后用
$oFrame = _IEFrameGetCollection ($oFrae, 0) ;0填自己需要的框架索引
自己动手丰衣足食

评分

参与人数 1金钱 +15 收起 理由
afan + 15 :)

查看全部评分

发表于 2010-9-18 09:51:21 | 显示全部楼层
楼主很强啊
发表于 2011-8-30 00:07:30 | 显示全部楼层
为了可恶心的钱钱,你懂的。
发表于 2011-8-30 00:08:17 | 显示全部楼层
回复 5# angelink


我日,这句话发错地方了,应该是发在另一个论坛上。。。
发表于 2011-10-28 05:34:19 | 显示全部楼层
发表于 2012-12-12 09:37:31 | 显示全部楼层
<DIV id=headerAll>
<DIV style="Z-INDEX: 10003; DISPLAY: none; TOP: 30%; LEFT: 30%" id=login_alert class=round>
<DIV class=r_top></DIV>
<DIV class=round_container>
<DIV class=r_title>用户登录<A class=close href="javascript:alert_login_close();"></A></DIV>
<DIV class=round_content><IFRAME style="BACKGROUND-COLOR: transparent; MARGIN: 0px 0px 10px 20px; WIDTH: 30px" id=embed_login_frame src="" frameBorder=0 allowTransparency name=embed_login_frame scrolling=no></IFRAME></DIV></DIV>
<DIV class=r_bottom></DIV></DIV>
<SCRIPT>
document.domain="qq.com";

function alert_login(url,isauto,lang,target){
        if(document.getElementById("login_alert").style.display=="block")
        {
                return ;
        }
        if (typeof lang == "undefined")
        {
                lang=0;                                //默认是简体中文
        }
        if(typeof url== "undefined")
        {
                url = "";
        }
        if(typeof isauto== "undefined")
        {
                isauto = true;
        }
        if (typeof target == "undefined")
        {
                target="top";                                //默认是简体中文
        }
                 if (document.body.clientHeight)        
                {
                        var sHeight = document.body.clientHeight ;
                }
                else if (window.innerHeight)
                {
                        var sHeight = window.innerHeight ;
                }

                if (document.body.clientWidth)        
                {
                        var sWidth = document.body.clientWidth;
                }
                else if (window.innerWidth)
                {
                        var sWidth = window.innerWidth;
                }
                var ptLoginUrl = window.location.protocol + "//ui.ptlogin2.qq.com/cgi-bin/login";
                /*if("https:" == window.location.protocol)
                {
                        ptLoginUrl = "https://ssl.ptlogin2.qq.com/cgi-bin/login";
                }*/
                var deturl = escape(getHost() + url);
                if(url.indexOf("http") == 0)
                {
                        deturl = escape(url);
                }
                var s_url = (0 == url.length ? escape(window.location.href) : deturl);
                var param = "?appid=2001601&no_verifyimg=1&f_url=loginerroralert&lang=" + lang +"&target="+target+"&hide_title_bar=1&s_url=" + s_url+ "&qlogin_jumpname=aqjump&qlogin_param="+escape("aqdest="+s_url)+"&css="+escape(getHost()+"/v2/css/login.css");
                var loginSrc = ptLoginUrl + param;
                document.getElementById("embed_login_frame").src = loginSrc;
                 var loginDiv = document.getElementById("login_alert");
                if(isauto)
                {
                        if(isIE6())
                        {
                                setCenter();
                        }
                        else
                        {
                                loginDiv.style.position = "fixed";
                                loginDiv.style.top = "27%";
                                loginDiv.style.left = "40%";
                                var FrameMarginTop =  -loginDiv.offsetHeight / 2 + "px";
                                var FrameMarginLeft = -loginDiv.offsetWidth / 2 + "px";
                                loginDiv.marginTop =   FrameMarginTop;
                                loginDiv.marginLeft = FrameMarginLeft;
                        }
                        
                }
                loginDiv.style.display = "block";
}
function alert_login_close()
{
        document.getElementById("login_alert").style.display = "none";
}
function ptlogin2_onResize(width, height) 
{
                //var outter_wnd = document.getElementById("login_round_info");
                var outter_wnd = document.getElementById("embed_login_frame");
                if (outter_wnd)        {
                        
                        outter_wnd.style.width = 350+"px";
                        outter_wnd.style.height = height+"px";
                        outter_wnd.style.visibility = "hidden";
                        outter_wnd.style.visibility = "visible";
                        
                }
}

function ptlogin2_onClose(){
                login_wnd = document.getElementById("login");        
                login_wnd.style.display="none"
                mybg = document.getElementById("mybg");
                mybg.style.display = "none";
                document.body.removeChild(mybg);
}
function getHost() {
        return window.location.protocol + "//" + window.location.host;
}
function isIE6()
{
        var isIE = (document.all)?true:false;
        is_IE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
        return is_IE6;
}
/*
 *兼容IE6的居中定位
 */
function setCenter(){
                        $("#login_alert").css("position","absolute");
                        var FrameMarginTop =  document.documentElement.scrollTop - document.getElementById("login_alert").offsetHeight/2 + "px";
                        var FrameMarginLeft = document.documentElement.scrollLeft  - document.getElementById("login_alert").offsetWidth/2 + "px";
                        $("#login_alert").css({"marginTop":FrameMarginTop,"marginLeft":FrameMarginLeft});
                }
</SCRIPT>

<DIV id=header>
<DIV id=top><A class=logo onclick="sendHotClick('HEADER.TO.LOGO');" href="/"><CITE>QQ安全中心<BR>在线生活安全护航</CITE></A> 
<DIV class=right_info>
<UL>
<LI>欢迎您,即墨年稳(1051904855)  </LI>
<LI style="DISPLAY: none" id=safe_score_item class=cent><A href="/cn2/index"><STRONG id=head_safe_score></STRONG></A></LI>
<LI><A href="javascript:LoginOut();">退出</A></LI>
<LI title=消息中心><A class=i16 onclick="sendHotClick('HEADER.TO.MSGCENTER');" href="/cn2/message_center/message_center_login?source_id=2300"><CITE>邮件</CITE></A></LI>
<LI id=header_safe_express><A onclick="sendHotClick('HEADER.TO.HELP');" href="/123" target=_blank>求助</A></LI>
<LI><A onclick="sendHotClick('HEADER.TO.REPORT');" href="/v2/safe_school/report_index.shtml" target=_blank>举报</A></LI>
<LI><A onclick="sendHotClick('HEADER.TO.FEEDBACK');" href="http://support.qq.com/discuss/387_1.shtml" target=_blank>反馈意见</A></LI>
<LI class=pr><A onmouseover="ShowSubMenu('site_map_menu');" onmouseout="HideSubMenu('site_map_menu');" href="javascript:;">站点地图<B></B></A></LI></UL></DIV></DIV>
<DIV id=menu>
<UL>
<LI id=menu_index><A class=m1 href="/cn2/index"><CITE>首页</CITE></A></LI>
<LI id=menu_toolbox><A class=m5 onmouseover="ShowSubMenu('submenu_toolbox');" onmouseout="HideSubMenu('submenu_toolbox');" href="/cn2/manage/my_mb"><CITE>密保工具箱</CITE></A></LI>
<LI id=menu_account_prot><A class=m2 onmouseover="ShowSubMenu('submenu_account_prot');" onmouseout="HideSubMenu('submenu_account_prot');" href="/cn2/safe_service/my_prot"><CITE>帐号保护</CITE></A></LI>
<LI id=menu_pwd_manage><A class=m3 onmouseover="ShowSubMenu('submenu_pwd_manage');" onmouseout="HideSubMenu('submenu_pwd_manage');" href="/cn2/psw_mgr/psw_mgr_index"><CITE>密码管理</CITE></A></LI>
<LI id=menu_safe_mutual><A class=m4 onmouseover="" href="/cn2/safe_school/safe_school_index"><CITE>安全学堂</CITE></A></LI></UL></DIV><A class=handheld href="/app" target=_blank></A><!--密保工具箱下拉菜单-->
<DIV style="DISPLAY: none" id=submenu_toolbox class="accounts_list toolbox_list" onmouseover="ShowSubMenu('submenu_toolbox', 'menu_toolbox', 'on5');" onmouseout="HideSubMenu('submenu_toolbox','menu_toolbox');" name="submenu">
<H3><A href="/cn2/manage/my_mb"><CITE>密保工具</CITE></A></H3>
<UL>
<LI><A class=t1 href="/cn2/manage/mobile/mobile_index?source_id=2228"><CITE>密保手机</CITE></A></LI>
<LI><A class=t2 href="/cn2/manage/mbtoken/mbtoken_home?source_id=2228"><CITE>手机令牌</CITE></A></LI>
<LI><A class=t3 href="/cn2/manage/qqtoken/qqtoken_home?source_id=2228"><CITE>QQ令牌</CITE></A></LI>
<LI><A class=t4 href="/cn2/manage/mbk/my_mbk?source_id=2228"><CITE>密保卡</CITE></A></LI>
<LI><A class=t5 href="/cn2/manage/question/my_question?source_id=2228"><CITE>密保问题</CITE></A></LI></UL></DIV><!--密保工具箱下拉菜单 End--><!--帐号保护下拉菜单-->
<DIV style="DISPLAY: none" id=submenu_account_prot class=accounts_list onmouseover="ShowSubMenu('submenu_account_prot','menu_account_prot','on2');" onmouseout="HideSubMenu('submenu_account_prot','menu_account_prot');" name="submenu">
<H3><A href="/cn2/safe_service/my_prot"><CITE>帐号保护</CITE></A></H3>
<UL>
<LI><A class=a1 href="/cn2/safe_service/my_qbqd_prot"><CITE>保护Q币Q点</CITE></A></LI>
<LI><A class=a2 href="/cn2/safe_service/my_game_prot"><CITE>保护游戏</CITE></A></LI>
<LI><A class=a3 href="/cn2/safe_service/my_login_prot"><CITE>保护QQ登录</CITE></A></LI>
<LI><A class=a4 href="/cn2/safe_service/my_key_prot"><CITE>保护QQ SHOW物品</CITE></A></LI></UL></DIV><!--帐号保护下拉菜单 End--><!--密码管理下拉菜单-->
<DIV style="DISPLAY: none" id=submenu_pwd_manage class="accounts_list password_list" onmouseover="ShowSubMenu('submenu_pwd_manage','menu_pwd_manage','on3');" onmouseout="HideSubMenu('submenu_pwd_manage','menu_pwd_manage');" name="submenu">
<H3><A href="/cn2/psw_mgr/psw_mgr_index"><CITE>密码管理</CITE></A></H3>
<UL>
<LI><A class=pw1 href="/cn2/change_psw/change_psw_index"><CITE>修改密码</CITE></A></LI>
<LI><A class=pw2 href="/cn2/findpsw/findpsw_index"><CITE>找回密码</CITE></A></LI>
<LI><A class=pw3 href="/cn2/ipwd/my_ipwd"><CITE>独立密码管理</CITE></A></LI>
<LI><A class=pw4 href="/cn2/appeal/appeal_index"><CITE>帐号申诉</CITE></A></LI></UL></DIV><!--密码管理下拉菜单 End--><!--站点地图-->
<DIV style="DISPLAY: none" id=site_map_menu class=m_h onmouseover="ShowSubMenu('site_map_menu');" onmouseout="HideSubMenu('site_map_menu');">
<DIV class=m_h_t>站点地图<B></B></DIV>
<DL>
<DT><A href="/cn2/index">首页</A></DT></DL>
<DL>
<DT><A href="/cn2/safe_service/my_prot">帐号保护</A></DT>
<DD><A href="/cn2/safe_service/my_qbqd_prot">Q币Q点保护</A> <A href="/cn2/safe_service/my_login_prot">QQ登录保护</A> <A href="/cn2/safe_service/my_game_prot">游戏保护</A> <A href="/cn2/safe_service/my_key_prot">QQ秀物品保护</A> </DD></DL>
<DL>
<DT><A href="/cn2/manage/my_mb">密保工具箱</A></DT>
<DD><A href="/cn2/manage/question/my_question">密保问题</A> <A href="/cn2/manage/mobile/mobile_index">密保手机</A> <A href="/cn2/manage/mbk/my_mbk">密保卡</A> <A href="/cn2/manage/qqtoken/qqtoken_home">QQ令牌</A> <A href="/cn2/manage/mbtoken/mbtoken_home">手机令牌</A> <A href="/cn2/manage/mb_reset/mb_reset_index">申请重置密保</A> </DD></DL>
<DL>
<DT><A href="/cn2/psw_mgr/psw_mgr_index">密码管理</A></DT>
<DD><A href="/cn2/findpsw/findpsw_index">找回密码</A> <A href="/cn2/change_psw/change_psw_index">修改密码</A> <A href="/cn2/appeal/appeal_index">帐号申诉</A><BR><A href="/cn2/ipwd/my_ipwd">独立密码管理</A> </DD></DL>
<DL>
<DT><A href="/cn2/safe_school/safe_school_index">安全学堂</A></DT></DL>
<DL class=n>
<DT class=g>其他</DT>
<DD><A href="/v2/safe_school/report_index.shtml">举报</A> <A href="/cn2/safe_school/website_report/website_topic_url?source_id=2486">网站安全服务平台</A> <A href="/cn2/personal_info/personal_info_index">个人资料</A><BR><A href="/v2/notice/notice.shtml">系统公告</A> <A href="http://service.qq.com/special_auto/aq.html">腾讯客服</A> <A href="/110?source_id=2495">防骗小助手</A> </DD></DL></DIV><!--站点地图end--></DIV></DIV><!--Header End-->
<SCRIPT>
function ShowSubMenu(submenu_id,menu_id,cname)
{
        $("div[name='submenu']").css("display","none");
        if(submenu_id == "site_map_menu")
        {
                $("#"+submenu_id).css({'display':'block'});
        }
        else
        {
                $("#"+submenu_id).css({'display':'block','cursor':'hand'});
        }
        if(typeof(menu_id) != "undefined")
        {
                $("#"+menu_id).attr("class",cname);
        }
}
function HideSubMenu(submenu_id,menu_id)
{
        $("#"+submenu_id).css("display","none");
        if(typeof(menu_id) != "undefined")
        {
                $("#"+menu_id).attr("class","");
        }
}

function LoginOut()
{
        document.cookie = "uin=; EXPIRES=Fri, 02-Jan-1970 00:00:00 GMT; PATH=/; DOMAIN=.qq.com";
        document.cookie = "skey=; EXPIRES=Fri, 02-Jan-1970 00:00:00 GMT; PATH=/; DOMAIN=.qq.com";
        document.cookie = "pt_mbkey=; EXPIRES=Fri, 02-Jan-1970 00:00:00 GMT; PATH=/; DOMAIN=.qq.com";
        top.location.reload();
}

$("#toolbox_hover").click(function(){
        location.href="/cn2/manage/my_mb";
});
/*$(document).ready(function(){
                        $.ajax({
                        url:"/cn2/ajax/get_safe_score",
                        async:true,
                        timeout:1000,
                        dataType:"json",
                        error:function(){},
                        success:function(msg){
                                if(msg.ret==0)
                                {
                                        $("#safe_score_item").css("display","");
                                        $("#head_safe_score").text(msg.score+"分");
                                        if(msg.rank < 4)
                                        {
                                                $("#head_safe_score").attr("className","l");
                                        }
                                        else if(msg.rank < 7)
                                        {
                                                $("#head_safe_score").attr("className","m");
                                        }
                                        else
                                        {
                                                $("#head_safe_score").attr("className","h");
                                        }
                                }
                        }
                });
});*/
function switchToOld()
{
        document.cookie = "aq_ver=redirect_to_aq_v1;PATH=/; DOMAIN=aq.qq.com";
        top.location.href="/cn/index";
}
</SCRIPT>
<!--Wrapper-->
<DIV id=wrapper>
<DIV class=top></DIV>
<DIV class=center>
<DIV class=center_left>
<H3><I class=i9></I><A style="TEXT-DECORATION: none" id=menu_prot href="/cn2/manage/my_mb">密保工具箱</A></H3>
<DIV class=menu_left>
<UL>
<LI id=mobile><A href="/cn2/manage/mobile/mobile_index?source_id=2230">密保手机</A></LI>
<LI id=mbtoken><A href="/cn2/manage/mbtoken/mbtoken_home?source_id=2230">手机令牌</A></LI>
<LI id=qqtoken><A href="/cn2/manage/qqtoken/qqtoken_home?source_id=2230">QQ令牌</A></LI>
<LI id=mbk><A href="/cn2/manage/mbk/my_mbk?source_id=2230">密保卡</A></LI>
<LI id=question class=on><A href="/cn2/manage/question/my_question?source_id=2230">密保问题</A></LI></UL></DIV></DIV>
<DIV class=center_right>
<DIV class=title_r><A onfocus=this.blur() href="/cn2/manage/my_mb">密保工具箱</A><EM> > </EM><A onfocus=this.blur() href="/cn2/manage/question/my_question">密保问题</A><EM> > </EM>设置密保问题</DIV><IFRAME id=ifid height=500 src="/cn2/manage/question/set_question_sel?mb_flow_type=setdir&outurl=setdir&;" frameBorder=0 width=740 scrolling=no></IFRAME></DIV></DIV>
<DIV class=bottom></DIV></DIV><!--Wrapper End--><!--Footer-->
<DIV id=footer>
<P><A href="http://www.tencent.com/" target=_blank>关于腾讯</A>|<A href="http://www.tencent.com/index_e.shtml" target=_blank>About Tencent</A>|<A href="http://www.qq.com/contract.shtml" target=_blank>服务条款</A>|<A href="http://hr.tencent.com/" target=_blank>腾讯招聘</A>|<A href="http://security.tencent.com" target=_blank>漏洞报告</A>|<A href="http://service.qq.com/" target=_blank>腾讯客服<SPAN id=debug></SPAN></A></P>
<P>Copyright ? 1998 - 2012 Tencent. All Rights Reserved </P>
<P>腾讯公司 版权所有</P></DIV>
<SCRIPT language=javascript>
        if (typeof(timePoints) != "undefined")        
        {
                timePoints[0] = new Date();        
                $(document).ready(function() {
                        timePoints[1] = new Date();
                });        
        }        
</SCRIPT>
<IFRAME style="WIDTH: 150px; DISPLAY: none; HEIGHT: 150px" id=aqrjs_hidden_frame name=aqrjs_hidden_frame></IFRAME><!--Footer End-->
<SCRIPT language=javascript>
        document.domain="qq.com";
        $("#question").addClass("on");
        $(document).ready(function(){
                asyLoadScript("/v2/js/aq_float_frame.js");
        });        
/*
        $("#modify").click(function() {
                CAqCommFrame.show({title: "修改密保问题", type:'iframe',jumpname: "modifyquestion"});
        });
        */
function checkEncrypt(jumpName)
{
        if (jumpName.match(/set/))
        {
                CAqCommFrame.show({title: "设置密保问题", type:'iframe',jumpname: jumpName});
        }
        else
        {
                CAqCommFrame.show({title: "修改密保问题", type:'iframe',jumpname: jumpName});
        }
  
  return 0;
}

function OnUnionVerifySuccess()
{
        $("#ifid").contents().find("form").submit();
        CAqCommFrame.close();
}
function removeAbnormal()
{
        CAqCommFrame.show({title:'解除限制', type:'iframe', jumpname:'jihuo'});
}

</SCRIPT>

<SCRIPT language=javascript src="http://pingjs.qq.com/ping.js"></SCRIPT>

<SCRIPT language=javascript src="http://aq.qq.com/v2/js/aqrjs_common.js"></SCRIPT>
发表于 2012-12-12 09:39:10 | 显示全部楼层
#include <IE.au3>
Local $s_Url="http://aq.qq.com/cn2/manage/enter?to=question&mb_flow_type=setdir&outurl=setdir&;"
Local $oIE=_IECreate($s_Url,1,1,1,0)

$oFrames = _IEFrameGetCollection ($oIE)
Local $iNumFrames = @extended
For $i = 0 to $iNumFrames - 1
$oForm = _IEFrameGetCollection($oIE, $i)
Local $oDoc = _IEDocGetObj($oForm)
$s2html = _IEDocReadHTML($oDoc)
MsgBox(0, "The URL", $s2html)
Next
找到3个Frame,可是获取不到Frame的内容
发表于 2015-7-1 23:47:25 | 显示全部楼层
很不错,我喜欢啊
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-10 17:48 , Processed in 0.083083 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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