我使用的是Delphi XE2 + TWebbrowser,网页源代码如下:
<html>
<head>
<title>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
var loaded = 0;function ScriptLoaded() { ++loaded; if(loaded == 2) ARSystemInit(); }
var ReportSelForm="ReportSelection", RelContextPath='../../../../',AbsContextPath=null;</script>
<link rel="stylesheet" href="../../../../resources/stylesheets/7.1.00 Patch 009 201002230034/ARSystem.css">
<link rel="stylesheet" href="../../../../resources/stylesheets/7.1.00 Patch 009 201002230034/ARSystem_zh.css">
<script type="text/javascript" src="../../../../resources/javascript/7.1.00 Patch 009 201002230034/LocalizedMessages_zh_CN.js" defer></script>
<script type="text/javascript" src="../../../../resources/javascript/7.1.00 Patch 009 201002230034/locale/zh_CN.js" defer></script>
<script type="text/javascript">function DVFsf(){return "\x3cHTML\x3e\x3c/HTML\x3e";} function DVFol(){}</script>
<script type="text/javascript" src="../../../../resources/javascript/7.1.00 Patch 009 201002230034/ClientCore.js" defer></script>
<script type="text/javascript" src="form.js/f7a68ba8.js" defer></script>
<script type="text/javascript">document.write('\x3cscript src="userdata.js?winname=ar05UltraProcess%3AITIL_Incident'+encodeURIComponent(name)+'" defer\x3e\x3c/'+'script\x3e');</script>
</head>
<body onload="ScriptLoaded()" draghandler="BodyDrag" style="display:none">
<div id="Toolbar"><div class="TBTopBarStatus">当前模式: <span class="TBTopBarStatusMode"></span></div><a class="btn TBTopBarBox" href="javascript:"><img class="tbright" src="../../../../resources/images/tb_right.gif" alt="显示工具栏" /><img class="tbdown" src="../../../../resources/images/tb_down.gif" alt="隐藏工具栏" /></a><table cellpadding=0 cellspacing=0 class="Toolbar"><tbody><tr><td nowrap class="TBGroup TBGroup0">
<a class="searchsavechanges btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBsearchsavechanges">搜索</div>
</a>
</td>
<td nowrap class="TBGroup TBGroup1">
<a class="newsearch btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBnewsearch"><img src="../../../../resources/images/tb_search.gif" alt="新搜索" /> 新搜索</div>
</a>
<a class="newrequest btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBnewrequest"><img src="../../../../resources/images/tb_request.gif" alt="新请求" /> 新请求</div>
</a>
<a class="modifyall btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBmodifyall"><img src="../../../../resources/images/tb_modall.gif" alt="全部修改" /> 全部修改</div>
</a>
</td>
<td nowrap class="TBGroup TBGroup2">
<a class="savedsearches btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBsavedsearches"> 多项搜索</div>
</a>
<a class="advancedsearch btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBadvancedsearch">高级搜索</div>
</a>
<a class="clear btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBclear">清除</div>
</a>
<a class="settodefaults btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBsettodefaults">设置为默认值</div>
</a>
<a class="statushistory btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBstatushistory">状态历史记录</div>
</a>
</td>
<td nowrap class="TBGroup TBGroup3">
<a class="logout btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBlogout">注销</div>
</a>
<a class="help btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBhelp">帮助</div>
</a>
<a class="home btn btn3d tbbtn" href="javascript:" style="position:static">
<div id="TBhome">主页</div>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div id="ResultsList">
<div arid=1020 artype="Table" ardbn="CustomResultsList" class="arfid1020 ardbnCustomResultsList" style="top:0; left:0; width:0; height:0;visibility:hidden;z-index:0;" arcols="2147483647" arcolws="1575" arcoldlen="254" ardrill=1 arserver="@" arschema="@" armaxrows=0 ardtype=1 arcsize=0 arfixhdr=1 arselrows=0 arselinit=0 arselrefresh=0 arautofit=0 arsort="" arqual="{qual:"", ids:[],extids:[]}"><img src="../../../../resources/images/menu_down.gif" alt="" class="TableSortImgUp" arindom=1 /><img src="../../../../resources/images/menu_up.gif" alt="" class="TableSortImgDown" arindom=1 /><div class='TableHdr'><table class='TableHdr' cellpadding=0 cellspacing=0><tbody><tr><td nowrap valign=middle class='TableHdrL'></td><td nowrap valign=middle class='TableHdrR'></td></tr></tbody></table></div><div class='TableInner'></div><div class='TableFtr'><table class='TableFtr' cellpadding=0 cellspacing=0><tbody><tr><td nowrap valign=middle class='TableFtrL'></td><td nowrap valign=middle class='TableFtrR'></td></tr></tbody></table></div></div>
</div>
<div id="Splitter" draggable=1 dragoriginal=1>
</div>
<div id="FormContainer" arcs=1 style="background-color:">
<div style="top:0;left:0;width:1173;height:869"> </div>
<div arid=700000002 artype="Char" ardbn="BaseName" class="df dfro arfid700000002 ardbnBaseName" style="z-index:994;top:2; left:9; width:100; height:25;">
<span style="top:0; left:0; width:100; height:0;"><label class="label f9" for="x-arid700000002" style="width:100px;left:0px;bottom:25px;color:;text-align:center;"></label></span><textarea class="text sr f2 dat" wrap="off" id="arid700000002" cols="20" maxlen=254 style="top:0; left:0; width:100; height:25;" readonly rows=1></textarea>
</div>
<a href="javascript:" arid=700040001 artype="Control" ardbn="Btn_Chart" class="btn btnurl arfid700040001 ardbnBtn_Chart" style="top:5; left:842; width:54; height:20;visibility:hidden;z-index:998;background-color:transparent;"><div class="btntextdiv" style="top:0; left:0; width:54; height:20;"><div class="f7" style=";width:54">流 程 图</div>
</div>
</a>
<a href="javascript:" arid=809041101 artype="Control" ardbn="Btn_AddDate" class="btn btnurl arfid809041101 ardbnBtn_AddDate" style="top:5; left:916; width:65; height:20;visibility:hidden;z-index:1004;background-color:transparent;"><div class="btntextdiv" style="top:0; left:0; width:65; height:20;"><div class="f7" style=";width:65">补充资料</div>
</div>
</a>
<a href="javascript:" arid=700040078 artype="Control" ardbn="Btn_Shengchengzhishi" class="btn btnurl arfid700040078 ardbnBtn_Shengchengzhishi" style="top:31; left:841; width:65; height:20;visibility:hidden;z-index:1003;background-color:transparent;"><div class="btntextdiv" style="top:0; left:0; width:65; height:20;"><div class="f7" style=";width:65">生 成 知 识</div>
</div>
</a>
**<a href="javascript:" arid=700040002 artype="Control" ardbn="Btn_Edit" class="btn btn3d btnd arfid700040002 ardbnBtn_Edit" style="top:32; left:916; width:65; height:20;visibility:hidden;z-index:999;"><div class="btntextdiv" style="top:0; left:0; width:65; height:20;"><div class="f1" style=";width:65">处 理</div>
</div>
</a>**
<div arid=700000003 artype="Char" ardbn="BaseSN" class="df dfro arfid700000003 ardbnBaseSN" style="z-index:995;top:7; left:592; width:198; height:20;">
<label class="label f6" for="x-arid700000003" style="top:4; left:0; width:51; height:16;">流水号:</label><textarea class="text sr dat" wrap="off" id="arid700000003" cols="20" maxlen=254 style="top:0; left:52; width:146; height:20;" readonly rows=1></textarea>
</div>
<div arid=700000004 artype="Char" ardbn="BaseCreatorFullName" class="df dfro arfid700000004 ardbnBaseCreatorFullName" style="z-index:996;top:7; left:252; width:122; height:20;">
<label class="label f6" for="x-arid700000004" style="top:4; left:0; width:60; height:16;">建单人名:</label><textarea class="text sr dat" wrap="off" id="arid700000004" cols="20" maxlen=254 style="top:0; left:61; width:61; height:20;" readonly rows=1></textarea>
</div>
<div arid=806000100 artype="Char" ardbn="Status" ardcf=1 class="df dfro arfid806000100 ardbnStatus" style="z-index:1002;top:7; left:110; width:134; height:20;">
<label class="label f6" for="x-arid806000100" style="top:4; left:0; width:38; height:16;color:;">状态:</label><textarea class="text sr dat" wrap="off" id="arid806000100" cols="20" maxlen=254 style="top:0; left:39; width:95; height:20;" readonly rows=1></textarea>
</div>
<div arid=700000006 artype="Time" ardbn="BaseCreateDate" class="df dfro arfid700000006 ardbnBaseCreateDate" style="z-index:997;top:7; left:386; width:194; height:20;">
<label class="label f6" for="arid700000006" style="top:4; left:0; width:60; height:16;">登记时间:</label><input id="arid700000006" class="text dat" type="text" style="top:0; left:61; width:133; height:20;" readonly ds=0 />
</div>
<div arid=700030001 artype="PageHolder" armaxh=22 class="PageHolder arfid700030001 ardbnPag_Main" style="top:52; left:12; width:973; height:419;background-color:white;z-index:1000;">
<div class="TabChildMissingBorder" style="visibility:hidden;top:22;width:973">
</div>
<div style="visibility:hidden;height:22;width:973" class="OuterTabsDiv">
<div class="ScrollingTab" style="position:relative;float:left;">
<span class="TabLeftRounded"> </span>
<span class="Tab"><a href="javascript:" class="btn" id="prevTab"><<</a>
</span>
<span class="TabRightRounded"> </span>
</div>
<div class="TabsViewPort" style="position:relative;overflow:hidden;float:left;width:5000;height:22">
<div style="overflow:visible;float:left;width:5000;top:0;left:0">
<dl class="OuterOuterTab">
<dd class="OuterTab" artabid=700030002><span class="TabLeftRounded"> </span>
<span class="Tab"><a href="javascript:" class="btn f1">基 本</a>
</span>
<span class="TabRight"> </span>
</dd>
<dd class="OuterTab" artabid=806842007><span class="TabLeft"> </span>
<span class="Tab"><a href="javascript:" class="btn f1">事件信息</a>
</span>
<span class="TabRight"> </span>
</dd>
<dd class="OuterTab" artabid=700030094><span class="TabLeft"> </span>
<span class="Tab"><a href="javascript:" class="btn f1">流程记录</a>
</span>
<span class="TabRightRounded"> </span>
</dd>
</dl>
</div>
</div>
看页面源码 BOLD 部分,是网页上的一个 BUTTON(arid=700040002 artype="Control" ardbn="Btn_Edit" )。当这个页面满载时,我想在 delphi 中按下按钮。