博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
autoit3 ie.au3 函数之——_IEAttach
阅读量:4052 次
发布时间:2019-05-25

本文共 1922 字,大约阅读时间需要 6 分钟。

_IEAttach: Attach to the specified instance of Internet Explorer where the search string sub-string matches (based on the selected mode).

即: 查找第一个存在的符合查找字串子串的IE例子,查找方式基于选择的模式

#include <IE.au3>

_IEAttach ( $s_string [, $s_mode = "Title" [, $i_instance = 1]] )

Parameters

$s_string String to search for (for "embedded" or "dialogbox", use Title sub-string or HWND of window)
$s_mode [optional] specifies search mode
Title = (Default) sub-string of main document title
WindowTitle = sub-string of full window title (instead of document title)
URL = sub-string or url of the current page
Text = sub-string in text from the body of the current page
HTML = sub-string in html from the body of the current page
HWND = hwnd of the browser window
Embedded = title sub-string or hwnd of of the window embedding the control
DialogBox = title sub-string or hwnd of modal/modeless dialogbox
Instance = $s_string is ignored, one browser reference returned (by matching instance number) from all available browser instances
$i_instance [optional] 1-based index into group of browsers or embedded browsers matching $s_string and $s_mode. See Remarks.

例子: 首先开打一个网页,可以在后台运行,其title 包含"百度一下", 然后显示其URL

; *******************************************************

; Example 1 - Attach to a browser with "AutoIt" in its title, display the URL
; *******************************************************
;

#include <IE.au3>

$bai_du = _IECreate("www.baidu.com")
Sleep(500)
$oIE = _IEAttach ("百度一下")
MsgBox(0, "The URL", _IEPropertyGet ($oIE, "locationurl"))

例子:当一个页面打开时, 可以根据其页面text来查找

; *******************************************************

; Example 2 - Attach to a browser with "手机数码"
;               in the text of it's top-level document
; *******************************************************
;
#include <IE.au3>
$360_buy = _IECreate("www.360buy.com")
Sleep(500)
$oIE = _IEAttach ("手机数码", "text")
MsgBox(0, "The URL", _IEPropertyGet ($oIE, "locationurl"))

转载地址:http://qgcci.baihongyu.com/

你可能感兴趣的文章
uboot.lds文件分析
查看>>
uboot start.s文件分析
查看>>
没有路由器的情况下,开发板,虚拟机Ubuntu,win10主机,三者也可以ping通
查看>>
本地服务方式搭建etcd集群
查看>>
安装k8s Master高可用集群
查看>>
忽略图片透明区域的事件(Flex)
查看>>
忽略图片透明区域的事件(Flex)
查看>>
AS3 Flex基础知识100条
查看>>
Flex动态获取flash资源库文件
查看>>
flex4 中创建自定义弹出窗口
查看>>
01Java基础语法-16. while循环结构
查看>>
01Java基础语法-18. 各种循环语句的区别和应用场景
查看>>
01Java基础语法-19. 循环跳转控制语句
查看>>
Django框架全面讲解 -- Form
查看>>
socket,accept函数解析
查看>>
今日互联网关注(写在清明节后):每天都有值得关注的大变化
查看>>
”舍得“大法:把自己的优点当缺点倒出去
查看>>
[今日关注]鼓吹“互联网泡沫,到底为了什么”
查看>>
[互联网学习]如何提高网站的GooglePR值
查看>>
[关注大学生]求职不可不知——怎样的大学生不受欢迎
查看>>