Skip to content Skip to sidebar Skip to footer

How Do I Access A Specific Html Element Using C#?

I have a string containing HTML and I need to be able to access a specific element to get the text from it (the element has no id or class or name so regex is out of the question).

Solution 1:

If the HTML is well formatted, you can parse the HTML with an XmlDocument

Also as Maxim mentioned, the HTML Agility Pack can probably do what you need.

Here's a recent article from 4guysfromrolla on parsing HTML with the HTML Agility Pack

Post a Comment for "How Do I Access A Specific Html Element Using C#?"