Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

get ClassName to my mshtml.webbrowser in winform

public void GetInfo()
{
HtmlDocument doc = webBrowser1.Document;
//HtmlElementCollection htmlColl = null;

HtmlElementCollection Links = webBrowser1.Document.GetElementsByTagName("a");

DataTable table = new DataTable("Table");
DataColumn column1 = new DataColumn("Col1");
DataColumn column2 = new DataColumn("Col2");
DataRow row = null;
table.Columns.Add(column1);
table.Columns.Add(column2);

foreach (HtmlElement el in Links)
{
if (el.OuterText != null)
if (el.InnerText != "")
if(el.Id != null)
{
row = table.NewRow();
row["Col1"] = el.OuterHtml;
row["Col2"] = el.InnerText;

table.Rows.Add(row);

}

}

listBox1.DataSource = table;
listBox1.DisplayMember = table.Columns[1].ToString();
listBox1.ValueMember = table.Columns[0].ToString();

}

thats the links Part that i found in the html page

how can i get the ClassName of the elements?

thanks roy
[1442 byte] By [royroy] at [2007-11-11 11:58:04]