ruby学习系列--操作htmlfile对象
2010-08-03 18:47
337 查看
1 require 'win32ole'
2
3 a = WIN32OLE.new('htmlfile')
4 methods = a.ole_methods.select { |m| m.visible? }
5 methods.each do |meth|
6 puts "#{meth.name}(" +meth.params.map {|p| "#{p.ole_type} #{p.name}" }.join(', ') + ")"
7 end
8
输出内容如下:
>ruby 本文件.rb
all()
body()
activeElement()
images()
applets()
links()
forms()
anchors()
title()
title()
scripts()
selection()
readyState()
frames()
embeds()
plugins()
alinkColor()
alinkColor()
bgColor()
bgColor()
fgColor()
fgColor()
linkColor()
linkColor()
vlinkColor()
vlinkColor()
referrer()
location()
lastModified()
url()
url()
domain()
domain()
cookie()
cookie()
defaultCharset()
defaultCharset()
mimeType()
fileSize()
fileCreatedDate()
fileModifiedDate()
fileUpdatedDate()
security()
protocol()
nameProp()
write(VARIANT psarray)
writeln(VARIANT psarray)
open(BSTR url, VARIANT name, VARIANT features, VARIANT replace)
close()
clear()
queryCommandSupported(BSTR cmdID)
queryCommandEnabled(BSTR cmdID)
queryCommandState(BSTR cmdID)
queryCommandIndeterm(BSTR cmdID)
queryCommandText(BSTR cmdID)
queryCommandValue(BSTR cmdID)
execCommand(BSTR cmdID, BOOL showUI, VARIANT value)
execCommandShowHelp(BSTR cmdID)
createElement(BSTR eTag)
onhelp()
onhelp()
onclick()
onclick()
ondblclick()
ondblclick()
onkeyup()
onkeyup()
onkeydown()
onkeydown()
onkeypress()
onkeypress()
onmouseup()
onmouseup()
onmousedown()
onmousedown()
onmousemove()
onmousemove()
onmouseout()
onmouseout()
onmouseover()
onmouseover()
onreadystatechange()
onreadystatechange()
onafterupdate()
onafterupdate()
onrowexit()
onrowexit()
onrowenter()
onrowenter()
ondragstart()
ondragstart()
onselectstart()
onselectstart()
elementFromPoint(I4 x, I4 y)
parentWindow()
styleSheets()
onbeforeupdate()
onbeforeupdate()
onerrorupdate()
onerrorupdate()
toString()
createStyleSheet(BSTR bstrHref, I4 lIndex)
releaseCapture()
recalc(BOOL fForce)
createTextNode(BSTR text)
documentElement()
attachEvent(BSTR event, DISPATCH pdisp)
detachEvent(BSTR event, DISPATCH pdisp)
onrowsdelete()
onrowsdelete()
onrowsinserted()
onrowsinserted()
oncellchange()
oncellchange()
ondatasetchanged()
ondatasetchanged()
ondataavailable()
ondataavailable()
ondatasetcomplete()
ondatasetcomplete()
onpropertychange()
onpropertychange()
dir()
dir()
oncontextmenu()
oncontextmenu()
onstop()
onstop()
createDocumentFragment()
onbeforeeditfocus()
onbeforeeditfocus()
getElementsByName(BSTR v)
getElementById(BSTR v)
getElementsByTagName(BSTR v)
focus()
hasFocus()
onselectionchange()
onselectionchange()
namespaces()
createDocumentFromUrl(BSTR bstrUrl, BSTR bstrOptions)
media()
media()
CreateEventObject(VARIANT pvarEventObject)
FireEvent(BSTR bstrEventName, VARIANT pvarEventObject)
createRenderStyle(BSTR v)
oncontrolselect()
oncontrolselect()
URLUnencoded()
onmousewheel()
onmousewheel()
doctype()
implementation()
createAttribute(BSTR bstrattrName)
createComment(BSTR bstrdata)
onfocusin()
onfocusin()
onfocusout()
onfocusout()
onactivate()
onactivate()
ondeactivate()
ondeactivate()
onbeforeactivate()
onbeforeactivate()
onbeforedeactivate()
onbeforedeactivate()
compatMode()
nodeType()
parentNode()
hasChildNodes()
childNodes()
attributes()
insertBefore(IHTMLDOMNode newChild, VARIANT refChild)
removeChild(IHTMLDOMNode oldChild)
replaceChild(IHTMLDOMNode newChild, IHTMLDOMNode oldChild)
cloneNode(BOOL fDeep)
removeNode(BOOL fDeep)
swapNode(IHTMLDOMNode otherNode)
replaceNode(IHTMLDOMNode replacement)
appendChild(IHTMLDOMNode newChild)
nodeName()
nodeValue()
nodeValue()
firstChild()
lastChild()
previousSibling()
nextSibling()
ownerDocument()
>Exit code: 0
2
3 a = WIN32OLE.new('htmlfile')
4 methods = a.ole_methods.select { |m| m.visible? }
5 methods.each do |meth|
6 puts "#{meth.name}(" +meth.params.map {|p| "#{p.ole_type} #{p.name}" }.join(', ') + ")"
7 end
8
输出内容如下:
>ruby 本文件.rb
all()
body()
activeElement()
images()
applets()
links()
forms()
anchors()
title()
title()
scripts()
selection()
readyState()
frames()
embeds()
plugins()
alinkColor()
alinkColor()
bgColor()
bgColor()
fgColor()
fgColor()
linkColor()
linkColor()
vlinkColor()
vlinkColor()
referrer()
location()
lastModified()
url()
url()
domain()
domain()
cookie()
cookie()
defaultCharset()
defaultCharset()
mimeType()
fileSize()
fileCreatedDate()
fileModifiedDate()
fileUpdatedDate()
security()
protocol()
nameProp()
write(VARIANT psarray)
writeln(VARIANT psarray)
open(BSTR url, VARIANT name, VARIANT features, VARIANT replace)
close()
clear()
queryCommandSupported(BSTR cmdID)
queryCommandEnabled(BSTR cmdID)
queryCommandState(BSTR cmdID)
queryCommandIndeterm(BSTR cmdID)
queryCommandText(BSTR cmdID)
queryCommandValue(BSTR cmdID)
execCommand(BSTR cmdID, BOOL showUI, VARIANT value)
execCommandShowHelp(BSTR cmdID)
createElement(BSTR eTag)
onhelp()
onhelp()
onclick()
onclick()
ondblclick()
ondblclick()
onkeyup()
onkeyup()
onkeydown()
onkeydown()
onkeypress()
onkeypress()
onmouseup()
onmouseup()
onmousedown()
onmousedown()
onmousemove()
onmousemove()
onmouseout()
onmouseout()
onmouseover()
onmouseover()
onreadystatechange()
onreadystatechange()
onafterupdate()
onafterupdate()
onrowexit()
onrowexit()
onrowenter()
onrowenter()
ondragstart()
ondragstart()
onselectstart()
onselectstart()
elementFromPoint(I4 x, I4 y)
parentWindow()
styleSheets()
onbeforeupdate()
onbeforeupdate()
onerrorupdate()
onerrorupdate()
toString()
createStyleSheet(BSTR bstrHref, I4 lIndex)
releaseCapture()
recalc(BOOL fForce)
createTextNode(BSTR text)
documentElement()
attachEvent(BSTR event, DISPATCH pdisp)
detachEvent(BSTR event, DISPATCH pdisp)
onrowsdelete()
onrowsdelete()
onrowsinserted()
onrowsinserted()
oncellchange()
oncellchange()
ondatasetchanged()
ondatasetchanged()
ondataavailable()
ondataavailable()
ondatasetcomplete()
ondatasetcomplete()
onpropertychange()
onpropertychange()
dir()
dir()
oncontextmenu()
oncontextmenu()
onstop()
onstop()
createDocumentFragment()
onbeforeeditfocus()
onbeforeeditfocus()
getElementsByName(BSTR v)
getElementById(BSTR v)
getElementsByTagName(BSTR v)
focus()
hasFocus()
onselectionchange()
onselectionchange()
namespaces()
createDocumentFromUrl(BSTR bstrUrl, BSTR bstrOptions)
media()
media()
CreateEventObject(VARIANT pvarEventObject)
FireEvent(BSTR bstrEventName, VARIANT pvarEventObject)
createRenderStyle(BSTR v)
oncontrolselect()
oncontrolselect()
URLUnencoded()
onmousewheel()
onmousewheel()
doctype()
implementation()
createAttribute(BSTR bstrattrName)
createComment(BSTR bstrdata)
onfocusin()
onfocusin()
onfocusout()
onfocusout()
onactivate()
onactivate()
ondeactivate()
ondeactivate()
onbeforeactivate()
onbeforeactivate()
onbeforedeactivate()
onbeforedeactivate()
compatMode()
nodeType()
parentNode()
hasChildNodes()
childNodes()
attributes()
insertBefore(IHTMLDOMNode newChild, VARIANT refChild)
removeChild(IHTMLDOMNode oldChild)
replaceChild(IHTMLDOMNode newChild, IHTMLDOMNode oldChild)
cloneNode(BOOL fDeep)
removeNode(BOOL fDeep)
swapNode(IHTMLDOMNode otherNode)
replaceNode(IHTMLDOMNode replacement)
appendChild(IHTMLDOMNode newChild)
nodeName()
nodeValue()
nodeValue()
firstChild()
lastChild()
previousSibling()
nextSibling()
ownerDocument()
>Exit code: 0
相关文章推荐
- File对象的基本操作学习
- FileGDB API for linux 学习系列之六,对象的创建
- Sharepoint学习笔记—ECMAScript对象模型系列-- 5、使用ECMA操作列表对象(list)
- ruby学习系列--操作windows控制面板
- javascript学习笔记--js对html对象的原生操作
- 【Ruby+Watir测试框架系列讲座 4】各类Web控件对象的自动化操作
- [原]【Ruby+Watir测试框架系列讲座 4】各类Web控件对象的自动化操作
- JQuery学习系列(七)HTML操作
- File对象的基本操作学习
- Sharepoint学习笔记—ECMAScript对象模型系列-- 6、使用ECMA操作列表项对象(list item)
- File对象的基本操作学习
- 黑马程序员--Java基础学习之IO流之File类、Properties对象、打印流、序列流等
- iOS学习之iOS沙盒(sandbox)机制和文件操作之NSFileManager(三)
- php设计模式学习系列(七)--原型对象
- C#2.0类和对象学习系列之构造函数
- 从0开始学习 GitHub 系列之「GitHub 常见的几种操作」
- 黑马程序员——JAVA学习笔记十一(文件操作File)
- Python学习笔记015——文件file的常规操作之一(文本文件)
- File对象的简单操作
- JAVA核心技术学习——流与文件(5.操作文件FILE)