找回密码
 加入
搜索
查看: 3466|回复: 8

[IE类操作] 求助:如何执行ie弹出窗口按扭[已解决]

  [复制链接]
发表于 2012-4-13 09:50:50 | 显示全部楼层 |阅读模式
本帖最后由 xjxcd 于 2012-4-16 14:59 编辑


执行_Ieaction($otext,"click")弹如上图对话框,如何发送命令确定点击,用send("{Enter}")、controlclick("Microsoft Inernet Explorer","您要删除此信息吗","[CLASS:button;INSTANCE:1]")都未能执行

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

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

查看全部评分

发表于 2012-4-13 11:22:28 | 显示全部楼层
WinActivate("Microsoft Inernet Explorer")
send("{Enter}")
 楼主| 发表于 2012-4-13 12:20:06 | 显示全部楼层
回复 2# haijie1223

试过WinActivate("Microsoft Inernet Explorer"),不启作用
发表于 2012-4-13 13:44:04 | 显示全部楼层
可以尝试使用timer消息
发表于 2012-4-13 15:17:34 | 显示全部楼层
回复 3# xjxcd


    Opt("WinTitleMatchMode",1)

评分

参与人数 1金钱 +10 收起 理由
xjxcd + 10

查看全部评分

发表于 2012-4-13 18:00:12 | 显示全部楼层
测试使用timer消息是有效果的
#include <IE.au3>
#include <Timers.au3>
$oIE = _IECreateEmbedded()
$gui = GUICreate("测试",600,600)
GUICtrlCreateObj($oIE,0,0,600,600)
GUISetState()

_IENavigate($oIE,@ScriptDir&"\test.html")
$iid = _Timer_SetTimer(0,250,"click")
_IELinkClickByText($oIE,"百度")

Do
Until GUIGetMsg()=-3

Func click($hwnd,$msg,$wPlate,$lPlate)
        $handle = WinWait("[class:#32770]")
        ControlClick($handle,"","Button1")
        _Timer_KillTimer(0,$iid)
EndFunc


test.html
<html>
  <body>
    <a href="http://www.baidu.com" onclick=alert("ok")>百度</a>                 
  </body>
</html>

评分

参与人数 3金钱 +20 贡献 +5 收起 理由
xjxcd + 10
zldfsz + 5 厉害
user3000 + 10 学习了

查看全部评分

 楼主| 发表于 2012-4-13 20:23:34 | 显示全部楼层
谢谢两位的帮助,星期一上班后回去测试,结果将报告.
 楼主| 发表于 2012-4-16 14:50:21 | 显示全部楼层
参考了http://www.autoitx.com/forum.php ... t=ie%2B%B5%E3%BB%F7解决了
       $oForm = _IEFormGetObjByName ($oIE1, "WarForm")
        $oText = _IEFormElementGetObjByName ($oForm, "DelSelect")
        $hwnd = _IEPropertyGet($oIE1, "hwnd")
        _IEAction ($oText, "focus")
        ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")
        WinWait("Microsoft Internet Explorer", "")
        ControlClick("Microsoft Internet Explorer", "", "[CLASS:Button; Instance:1;]")
发表于 2013-4-10 15:39:32 | 显示全部楼层
标记下 JAVASCRIPT ALERT CONFIRM 弹出框 点击 卡住 脚本 IE
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-13 00:23 , Processed in 0.091362 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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