vb WebBrowser1 如何模拟点击这个按钮 40
<aclass="btn-24-whiteadmin-btn"data-action="accuse"href="#">检举</a>没有ID~~~谢谢~...
<a class="btn-24-white admin-btn" data-action="accuse" href="#">检举</a>
没有ID~~~
谢谢~ 展开
没有ID~~~
谢谢~ 展开
1个回答
展开全部
引用mshtml
遍历元素:
IHTMLDocument3 doc =webbrowser1.Document as IHTMLDocument3 ;
IHTMLElementCollection eles = doc.getElementsByTagName(“A”) as IHTMLElementCollection;
string str_temp;
foreach (IHTMLElement ele in eles)
{
if (ele.getAttribute("InnerText", 0) != null)
{
str_temp = ele.getAttribute(“InnerText”, 0).ToString();
if (str_temp == “检举”)
{
return ele; // 得到元素!
}
}
}
遍历元素:
IHTMLDocument3 doc =webbrowser1.Document as IHTMLDocument3 ;
IHTMLElementCollection eles = doc.getElementsByTagName(“A”) as IHTMLElementCollection;
string str_temp;
foreach (IHTMLElement ele in eles)
{
if (ele.getAttribute("InnerText", 0) != null)
{
str_temp = ele.getAttribute(“InnerText”, 0).ToString();
if (str_temp == “检举”)
{
return ele; // 得到元素!
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询