【求救啊】没有form,没有name,只有id和无数个tr和td,怎么找控件?
准备用BCB6 的CppWebBroswer搞页面遍历,现在卡在登录这个事情上了。。
在网上找了好几个实例,都是说用IHTMLInputElement这个方法,来遍历查找控件name,id啥的,
关键是,我现在这边的web上面,只有一个input输入框和一个按钮,还都没有name,也没有用form,
已有的示例试了下都不行,
贴一下网页的源码:
<body data-spy="scroll" data-target=".bs-docs-sidebar" style="background-color:#e7e7e7;" class="ember-application">
<div id="indexcontent" class="clearboth" align="center" style="height:612px;">
<img id="guidebg" src="/res/bg.jpg" height="642px" style="right:0;bottom:0;position:absolute;top:0;left:0;z-index:-1;width:100%;min-width:1000px;">
<div class="clearboth rounddiv" style="width:1000px;padding-top:42px;">
<div align="center" class="clearboth width_100p">
<div class="clearboth">
<table style="width:626px;height:440px;margin-left:3px;" cellpadding="0" cellspacing="0" frame="void" rules="none">
<tbody>
<tr>
<td style="text-align:center;width:100%;">
<div id="logintable" align="center" style="color:#ffffff;margin-top:27px;margin-left:4px;">
<div id="ember273" class="ember-view">
<table id="ember311" class="ember-view">
<tbody><tr><td id="logininfo" style="height:40px;font-size:14px;color:#e0ecf7;text-align:left;padding-left:5px;"><script id="metamorph-4-start" type="text/x-placeholder"></script>请输入登录密码<script id="metamorph-4-end" type="text/x-placeholder"></script></td></tr>
<tr><td id="loginpassword" style="padding-left:2px;">
<div class="input_left"> </div>
<input autocomplete="off" type="password" class="input_text" id="userpassword" onkeydown="fncKeyStop(event);" onpaste="return false;" oncontextmenu="return false;" style="width:293px;color:#ffffff;">
<div class="input_right"> </div>
</td></tr>
<tr><td id="loginerror" style="height:20px;"><table id="loginerrortable" class="hide" style="display: table;"><tbody><tr><td><div class="ic-sign"></div></td><td style="padding-left:5px;color:#b7d4ec;font-size:12px;" id="errorCategory">密码有误,请重新输入。</td></tr></tbody></table></td></tr>
<tr><td style="height:80px;">
<div id="ember316" class="ember-view">
<button id="loginbtn" class="loginbutton" style="font-size:18px;color:white;" onclick="Atp.LoginController.postData();"><script id="metamorph-5-start" type="text/x-placeholder"></script>登录<script id="metamorph-5-end" type="text/x-placeholder"></script></button>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
有没有大神帮忙看下,怎么用下面这套东东实现自动填表登录啊~
IDispatch *spDispatch;
IHTMLDocument2 *pDoc2;
IHTMLElement *pElement;
IHTMLElementCollection *pElementCol;
IHTMLFormElement *pFormElement;
IHTMLInputElement *pInputElement;