C# webbrowser遍历网页元素

//不引用其它单元
 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;
                    }
                }
原文地址:https://www.cnblogs.com/liguangsunls/p/7160526.html