使用IEAction避免可见窗口

时间:2017-03-28 17:48:22

标签: internet-explorer autoit

我很难隐藏_IEAction($oIE_Input, "click")创建的新窗口。代码:

$oIE = _IECreate("mypage")
Sleep(20000)
$oIE_Input= _IEGetObjById($oIE, "the button")
_IEAction($oIE_Input, "click")
Sleep(20000)
_IEQuit($oIE)

当按下按钮时,Internet Explorer将打开一个新的可见窗口。如何避免或隐藏打开新窗口?

1 个答案:

答案 0 :(得分:-1)

也许你可以在后台启动整个IE会话。看看_IECreate参数。

隐藏浏览器窗口

$sUrl [optional] specifies the Url to navigate to upon creation 
$iTryAttach [optional] specifies whether to try to attach to an existing window
    0 = (Default) do not try to attach
    1 = Try to attach to an existing window 
$iVisible [optional] specifies whether the browser window will be visible
    0 = Browser Window is hidden
    1 = (Default) Browser Window is visible 
$iWait [optional] specifies whether to wait for page to load before returning
    0 = Return immediately, not waiting for page to load
    1 = (Default) Wait for page load to complete before returning 
$iTakeFocus [optional] specifies whether to bring the attached window to focus
    0 = Do not bring window into focus
    1 = (Default) bring window into focus