C#利用webBrowser怎么去掉网页中不想显示的部分高手请指教!!

2024-11-14 13:24:35
推荐回答(4个)
回答1:

HTMLDocument thedocument = WebBrowser.document.all;
HTMLElement theelement = thedocument.getElementById(""); //这里找你要藏的东西的ID;
theelement.setAttribute("visible",false); //藏起来

回答2:

HTMLDocument thedocument = WebBrowser.document.all;
HTMLElement theelement = thedocument.getElementById(""); //这里找你要藏的东西的ID;
theelement.setAttribute("visible",false); //藏起来 或HtmlElement htm = webBrowser1.Document.GetElementById("控件ID");
htm.OuterHtml = "";

回答3:

HtmlElement htm = webBrowser1.Document.GetElementById("控件ID");
htm.OuterHtml = "";

回答4:

隐藏CSS属性就可以了