3

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 Answer 1

3
 HtmlDocument doc = new HtmlDocument(); doc.Load("file.htm"); foreach(HtmlNode node in doc.DocumentNode.SelectNodes("//*"){ ///..... do something with node } 
Sign up to request clarification or add additional context in comments.

4 Comments

i kinda need it to put in a collection. and single tag per row.
Selectnodes returns HtmlNode collection, why don't you ask you question in a correct way so people can answer?
:). 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 .
Yes sorry, DocumentNode. Updated the sample

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.