用 axWebBrowser 获取打开网页的源代码,总是只能取一部分????
好像和 javascript 有关。
代码如下:
string htmlCode = " ";
mshtml.HTMLDocumentClass document = (mshtml.HTMLDocumentClass)this.axWebBrowser.Document;
foreach(mshtml.HTMLBaseElement a in document.all) {
string tag = a.tagName.ToLower();
if(tag == "table ") {
htmlCode += a.outerHTML;
}
}
string s = htmlCode;
------解决方案--------------------have you tried document.innerHTML?
------解决方案--------------------document.docummentElement.innerHTML