无法在AutoIt脚本中获取IE对象 - _IESTATUS_NoMatch

时间:2014-09-16 14:50:46

标签: internet-explorer autoit mcafee

我正在尝试使用嵌入式IE实例(ClassnameNN:Internet Explorer_server1)自动化GUI。但我无法获取/附加IE对象,尝试了多种方式,并且所有方法都返回错误_IESTATUS_NoMatch。更具体地说,我正在自动化McAfee防病毒软件:

AutoItSetOption("WinTitleMatchMode", 2)

$oie = _IEAttach("McAfee AntiVirus", "embedded")
$oie = _IEAttach("McAfee AntiVirus", "embedded", 1)
$oie = _IEAttach("[CLASS:Internet Explorer_Server; INSTANCE:1]", "embedded")
$oie = _IEAttach("[CLASS:Internet Explorer_Server; INSTANCE:1]", "text")
$oie = _IEAttach("", "instance", 1)
$oie = _IEAttach("")
$oie = _IEAttach("", "embedded")
$sText = _IEBodyReadText($oie)

$h_result = WinGetHandle("McAfee AntiVirus", "")
$o_result = __IEControlGetObjFromHWND($h_result)

; each _IEAttach() returns:
; --> IE.au3 T3.0-1 Warning from function _IEAttach, $_IESTATUS_NoMatch

我尝试使用IE8,IE9,IE10,IE11 - 每次都是相同的结果。

我只需要从McAfee扫描结果中读取文本。解决此问题的其他任何解决方法?

1 个答案:

答案 0 :(得分:1)

这适合你吗?

#RequireAdmin
Opt("WinSearchChildren", 1) ;0=no, 1=search children also
#include <IE.au3> 

AutoItSetOption("WinTitleMatchMode", 2)
$HWND = WinGetHandle("McAfee AntiVirus", "")
$oie = _IEAttach($HWND, "embedded")

ConsoleWrite(_IEDocReadHTML($oIE) & @CRLF)
相关问题