首页 > Windows开发 > 详细

C# webbrowser遍历网页元素

时间:2014-10-10 20:57:45      阅读:515      评论:0      收藏:0      [点我收藏+]
//不引用其他单元
 foreach(HtmlElement ele in WB1.Document.All)
                {
                  if(ele.InnerText=="下一页>")
                  {
                    bl_exist=true;
                    ele.InvokeMember("Click");
                    break;
                  }
                }
//引用mshtml;
  IHTMLDocument2 doc = WB1.Document.DomDocument as IHTMLDocument2;
                foreach (IHTMLElement ele in doc2.all)
                {
                    if (ele.innerText == "下一页>")
                    {
                        bl_exist = true;
                        ele.click();
                        break;
                    }
                }

C# webbrowser遍历网页元素

原文:http://blog.csdn.net/xtfnpgy/article/details/39968897

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!