如何通过WebBrowser

时间:2016-06-03 07:43:44

标签: c# webbrowser-control

点击页面的Html代码为:

<tr>
    <td style="width:140px;height:25%;padding-top:7px;padding-bottom:15px;">
    <a id="aaab.ClockInCompView.P10" ct="B" st="" href="javascript:void(0);" class="urBtnStd" ocl="return me.h_e(event,window,this,'Button','BUTTONCLICK',{'Id':'aaab.InClockCompView.P10'},'',true);" onkeydown="return me.h_m(event,window,'ur_Button_keypress(SSR.event)');" onclick="return me.h_m(event,window,'ur_Button_click(SSR.event)');" style="width:140px;text-align:center;overflow:visible;width:140px;" he>Clock-In</a>
    </td>
</tr>

我尝试使用此代码点击:

webBrowser1.Document.GetElementById("aaab.InClockCompView.P10").InvokeMember("click");

但是没找到按钮。是否可以使用webbrowser控件通过代码单击此类按钮?

0 个答案:

没有答案