views:

90

answers:

1

How can i select all html tags using Html Agility Pack and put it in a List so i can see all the available tags in a web page.

Thanks,

jepe

+1  A: 
 HtmlDocument doc = new HtmlDocument();
 doc.Load("file.htm");
 foreach(HtmlNode node in doc.DocumentNode.SelectNodes("//*"){
         ///..... do something with node
 }
dr. evil
i kinda need it to put in a collection. and single tag per row.
Jepe d Hepe
Selectnodes returns HtmlNode collection, why don't you ask you question in a correct way so people can answer?
dr. evil
:). sorry, my bad. Also, doc.DocumentElement does not exist in HtmlAgilitypack.Htmldocument. do you mean doc.DocumentNode? or my htmlagilitypack is not updated. I'm using 1.3.9.1 .
Jepe d Hepe
Yes sorry, DocumentNode. Updated the sample
dr. evil