本文共 2006 字,大约阅读时间需要 6 分钟。
_IECreate: Create an Internet Explorer Browser Window.
创建一个IE浏览器窗口.
格式:
#include <IE.au3>
_IECreate ( [$s_Url = "about:blank" [, $f_tryAttach = 0 [, $f_visible = 1 [, $f_wait = 1 [, $f_takeFocus = 1]]]]] )Parameters
$s_Url | [optional] specifies the Url to navigate to upon creation |
$f_tryAttach | [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 |
$f_visible | [optional] specifies whether the browser window will be visible 0 = Browser Window is hidden 1 = (Default) Browser Window is visible |
$f_wait | [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 |
$f_takeFocus | [optional] specifies whether to bring the attached window to focus 0 = Do not bring window into focus 1 = (Default) bring window into focus |
例子: 打开一个网页
; *******************************************************
; Example 1 - Create a browser window and navigate to a website ; ******************************************************* ; #include <IE.au3> $oIE = _IECreate ("www.autoitscript.com")例子:打开一个网页, 如果不存在就打开,如果已经存在就不用重新打开。 但是当已经存在时会有问题产生。 暂时不清楚什么原因。
; *******************************************************
; Example 2 - Create new browser windows pointing to each of 3 different URLs ; if one does not already exist ($f_tryAttach = 1) ; do not wait for the page loads to complete ($f_wait = 0) ; ******************************************************* ; #include <IE.au3> _IECreate ("www.autoitscript.com", 1, 1, 0) _IECreate ("my.yahoo.com", 1, 1, 0) _IECreate ("www.google.com", 1, 1, 0)例子: 打开一个空的网页, 并修改原代码。
; *******************************************************
; Example 4 - Create an empty browser window and populate it with custom HTML ; ******************************************************* ; #include <IE.au3> $oIE = _IECreate () $sHTML = "<h1>Hello World!</h1>" _IEBodyWriteHTML ($oIE, $sHTML)转载地址:http://rgcci.baihongyu.com/