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

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

_IEGetObjByName AND _IEGetObjByIdReturns an object variable by name or id.

即: 返回一个指定id或者name的对象变量

#include <IE.au3>

_IEGetObjByName ( ByRef $o_object, $s_Id [, $i_index = 0] )

例子:

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

; Example 1 - Open a browser to the form example, get an object reference
;               to the element with the id "su".  In this case the
;               result is identical to using $oSubmit = _IEGetObjById ($oIE, "su")
; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate ("www.baidu.com")
Sleep(1000)
$oSubmit = _IEGetObjById ($oIE, "su")

例子:

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

; Example 1 - Open a browser to the basic example, get an object reference
;               to the DIV element with the ID "line1". Display the innerText
;               of this element to the console.
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("basic")
$oDiv = _IEGetObjById ($oIE, "line1")
ConsoleWrite(_IEPropertyGet($oDiv, "innertext") & @CRLF)

PS: 这个方法应该比较实用, 尤其是用到页面元素的时候。

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

你可能感兴趣的文章
Node.js中的事件驱动编程详解
查看>>
mongodb 命令
查看>>
MongoDB基本使用
查看>>
mongodb管理与安全认证
查看>>
nodejs内存控制
查看>>
nodejs Stream使用中的陷阱
查看>>
MongoDB 数据文件备份与恢复
查看>>
数据库索引介绍及使用
查看>>
MongoDB数据库插入、更新和删除操作详解
查看>>
MongoDB文档(Document)全局唯一ID的设计思路
查看>>
mongoDB简介
查看>>
Redis持久化存储(AOF与RDB两种模式)
查看>>
memcached工作原理与优化建议
查看>>
Redis与Memcached的区别
查看>>
redis sharding方案
查看>>
程序员最核心的竞争力是什么?
查看>>
Node.js机制及原理理解初步
查看>>
linux CPU个数查看
查看>>
分布式应用开发相关的面试题收集
查看>>
简单理解Socket及TCP/IP、Http、Socket的区别
查看>>