المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Getting a out of a DOM element



C# Programming
01-12-2010, 03:50 PM
Hi All
I am creating an application in order to get the DOM info of a Web Page.
I cannot extract a tag using my application.
I am using

*the control WebBrowser shipped by Visual Studio
*a reference to the Com Microsoft.mshtml 7.0.3300.0

If I use the "Internet Explorer Developer Tool" I can see all information I need.

The tag has id "tbody_rank_by_level" and carries a list of tags full of data
that are showed in attributes innertHTML and innertText.

Using the code below innertHtml and innertText are both null.
What I am doing wrong?

mshtml.IHTMLDocument3 domDoc = this.webBrowser.Document.DomDocument as mshtml.IHTMLDocument3;
mshtml.IHTMLElement element = domDoc.getElementById("tbody_rank_by_level");
String innerHtml = element.innerHTML;
String innerText = element.innerText;