当前位置:编程学习 > C#/ASP.NET >>

高手进,关于自动点击<button

这是网页按钮的源代码,如何写程序让其程序自动点击该按钮。
<li class="">
<button type="button" class="se2_to_html">
<span>HTML</span>
</button>
</li>


用下面的办法只对<input type="button"管用,对上面的代码不管用
HtmlDocument document = this.webBrowser.Document;
            HtmlElementCollection elems = webBrowser.Document.GetElementsByTagName("button");
            foreach (HtmlElement em in elems)                  
            {
                if (em.GetAttribute("class") == "se2_to_html")
                {
                    em.InvokeMember("click");
                }
            } button 自动点击<button --------------------编程问答--------------------  if (em.GetAttribute("class") == "se2_to_html")
=>
 if (em.GetAttribute("classname") == "se2_to_html")
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,