autoit3 ie.au3 函数之——_IEBodyReadHTML、_IEBodyWriteHTML

来源:互联网 发布:java读取文件并写入 编辑:程序博客网 时间:2024/06/06 06:30

_IEBodyReadHTML : Returns the HTML inside the <body> tag of the document.

即:返回文档内 <body> 标签内的HTML代码

#include <IE.au3>
_IEBodyReadHTML ( ByRef $o_object )


例子: 提取已知网页代码, 并进行修改。

#include <IE.au3>
$oIE = _IECreate ("basic")
$sHTML = _IEBodyReadHTML ($oIE)
$sHTML = $sHTML & "<p><font color=red size=+5>Big RED text!</font>"
_IEBodyWriteHTML ($oIE, $sHTML)


_IEBodyWriteHTMLReplaces the HTML inside the <body> tag of the document.

即: 替换文档内 <body> 标签内的HTML代码.

#include <IE.au3>
_IEBodyWriteHTML ( ByRef $o_object, $s_html )

Parameters

$o_objectObject variable of an InternetExplorer.Application, Window or Frame object$s_htmlThe HTML string to write to the document

例子:重写已知代码

#include <IE.au3>
$oIE = _IE_Example ("iframe")
$oFrame = _IEFrameGetObjByName ($oIE, "iFrameTwo")
_IEBodyWriteHTML ($oFrame, "Hello <b>iFrame!</b>")




原创粉丝点击