Webbrowser中IHTMLElement、IHTMLElement2、IHTMLDocument2、IHTMLDocument2属性介绍
一、IHTMLElement接口
ele.click -----------点击事件
ele.setAttribute(const strAttributeName: WideString; AttributeValue: OleVariant; lFlags: Integer); --- 设置属性名称
ele.getAttribute(const strAttributeName: WideString; lFlags: Integer): OleVariant; -------------------------获取属性名称
ele.contains(const pChild: IHTMLElement): WordBool; --------------是否包含某子元素
ele.scrollIntoView(True) 元素滚动到可见
ele.insertAdjacentHTML('afterEnd','<br><input name="txt1">');
ele.id
ele.className ------------获取元素class名称
ele.tagName ------------获取元素tag
ele.style ------------获取元素的style
ele.parentElement --------获取元素的父元素
ele.all --------获取元素的子元素集合
ele.InnerText ---------获取元素的文本内容 OuterText
ele.InnerHTML ---------获取元素的源代码 OuterHTML
二、IHTMLElement2接口
ele2..setCapture(true) ----------------------设置元素可捕获鼠标事件
document.body.componentFromPoint(event.clientX,event.clientY)
---获取坐标位置的元素
document.elementFromPoint(
iX , iY ) ---获取坐标位置的元素
ele2.getBoundingClientRect-----------------------获取元素的矩形坐标
ele2.DoScroll ----------------------------------滚动
document.body.doScroll("scrollbarPageRight");
ele2.doScroll("scrollbarDown");
ele2.focus----------------------------------------设置焦点
ele2.blur ---------------------------------------设置失去焦点
ele2.getClientRects -------------------------------------------获取元素坐标
document.getElementsByTagName('input').item('bb',0) --------------根据tag获取元素
js触发onchange事件:
var oEvent = document.createEventObject();
document.getElementById('addrCity').fireEvent('onchange', oEvent);
Webbrowser中IHTMLElement、IHTMLElement2、IHTMLDocument2、IHTMLDocument2属性介绍的更多相关文章
- 在WebBrowser中执行javascript脚本的几种方法整理(execScript/InvokeScript/NavigateScript) 附完整源码
[实例简介] 涵盖了几种常用的 webBrowser执行javascript的方法,详见示例截图以及代码 [实例截图] [核心代码] execScript方式: 1 2 3 4 5 6 7 8 9 1 ...
- 关于delphi点击webbrowser中任意一点的问题
关于delphi点击webbrowser中任意一点的问题 有时候我们需要delphi载入webbrowser1打开网页的时候 需要点击某一个点的位置 可能是坐标 可能是按钮 可能是其他的控件应该如何来 ...
- C#:WebBrowser中伪造referer,为何对流量统计器无效?
使用webbrowser伪造referer的方法:webBrowser1.Navigate(url, "_self", null, "Referer:http://www ...
- webBrowser中操作网页元素全攻略
原文 webBrowser中操作网页元素全攻略 1.获取非input控件的值: webBrowser1.Document.All["控件ID"].InnerText; 或webBr ...
- 从WebBrowser中取得Cookie 和 WebClient设置cookie!
原文:从WebBrowser中取得Cookie 和 WebClient设置cookie! 从WebBrowser中取得Cookie 的代码 CookieContainer myCookieContai ...
- firame标签: IHTMLElement -> IHTMLFrameBase2 -> IHTMLWindow2 -> IHTMLDocument2 跨域访问
获得iframe标签的元素指针 CComPtr<IHTMLElement> spAdIframe = ... CComQIPtr<IHTMLFrameBase2> spFram ...
- WebBrowser 中遍历所有的frames
枚举所有iframe的IWebBrowser2 // Get the IDispatch of the document. // LPDISPATCH lpDisp = NULL; lpDisp = ...
- Webbrowser中模拟连接点击(非鼠标模拟)
Delphi uses mshtml, ActiveX; //初始加载网易主页 procedure TForm1.FormCreate(Sender: TObject); begin Webbrows ...
- WebBrowser中获得脚本中的变量值
//项目中添加Micrsoft.mshtml引用 --c:/temp/temp.htm-- <html> <script language="JavaScript" ...
随机推荐
- 10 Rules of Highly Successful Project Management
I commited the information below to report PDU of PMI. ^_^. In this paper, the author introduces his ...
- Linux 日志分析工具之awstats
一.awstats 是什么 官方网站:AWStats is a free powerful and featureful tool that generates advanced web, strea ...
- KiCad 如何在原理图添加元件时看到 PCB 封装?
KiCad 如何在原理图添加元件时看到 PCB 封装? 这个功能默认是关闭,评估关闭的原因是因为 PCB 封装很大,而且在前期也没必要详细知道 PCB 封装. 但是有时修改可以看到 PCB 封装会方便 ...
- requestAnimationFrame 知识点
与setTimeout相比,requestAnimationFrame最大的优势是由系统来决定回调函数的执行时机.具体一点讲,如果屏幕刷新率是60Hz,那么回调函数就每16.7ms被执行一次,如果刷新 ...
- jdk动态代理在idea的debug模式下不断刷新tostring方法
在jdk的动态代理下,在使用idea进入动态代理的debug模式下,单步调试会刷新idea的tostring方法,让他自己重走了一遍代理 这个问题暂时无解
- 七、springboot(四)配置redis
1.添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId> ...
- monkey如何获取app包名
别人学习网址:http://www.51testing.com/html/58/15092658-2984032.html 使用aapt aapt是sdk自带的一个工具,在sdk\builds- ...
- java 泛型与通配符(?)
泛型应用于泛型类或泛型方法的声明. 如类GenericTest public class GenericTest<T> { private T item; public void set( ...
- Hadoop "Cannot create directory .Name node is in safe mode."解决方案
转载自:http://www.waitig.com/hadoop-name-node-is-in-safe-mode.html 在使用Hadoop建立文件的时候,出现“Cannot create di ...
- Windows消息【一】 消息队列
看了MSDN后,以下是我个人的理解! 消息能够被分为「队列化消息」和「非队列化消息」. 队列化消息是指当程序发生某事件时,由Windows主动捕获并把消息放入系统消息队列中,而程序在运行时会初始化一个 ...