First of all, inner text if a property of an HTML element (instance), not a class. However, you can classify elements by CSS classes, which is routinely done in JavaScript.
But you need to do it in C# which you use to download HTML. Of course you can do it, you just need to parse HTML downloaded. Perhaps the most suitable tool is the open-source HTML Agility Pack, which can do exactly what you want: XPath. Please see:
HTML Agility Pack — Home.
See also:
Web scraping — Wikipedia, the free encyclopedia,
Comparison of HTML parsers — Wikipedia, the free encyclopedia.
See also ScrapySharp, a Web scraping tool which contains a Web client used to simulate a browser and an extension of HTML Agility Pack:
https://www.nuget.org/packages/ScrapySharp.
Note that you can use HTML Agility Pack or ScrapySharp for direct downloading of the resources from the Web, so you won't really need to use the class
WebClient
. However, it's good to know that
WebClient
is a pretty much rudimentary tool; a really comprehensive facility for retrieving resources from the Web (Web scraping, and stuff like that) is the class
System.Net.HttpWebRequest
:
HttpWebRequest Class (System.Net).
—SA