How to access a specific HTML element using C #?

I have a line containing HTML, and I need to have access to a specific element in order to get text from it (the element has no identifier or class or name, so there can be no question).

For example, let's say I need to access: "/ html / body / div / div [3] / div / table [0] / div / ul / li [12] / a /".

How can i do this?

+1
source share
1 answer

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

Also, as Maxim noted, the HTML Agility Pack will probably do everything you need.

Here is a recent 4guysfromrolla article on parsing HTML with HTML agility package

+1
source

All Articles