I have been trying to use this code to read the element by class in html/ajax knowing GetElementByClass is not a option in webBrowser.Document. I can\'t seem to get a return
I admit it's not very intuitive but you need to use GetAttribute("className") instead of GetAttribute("class")
HtmlElementCollection theElementCollection = default(HtmlElementCollection);
theElementCollection = webBrowser1.Document.GetElementsByTagName("span");
foreach (HtmlElement curElement in theElementCollection)
{
if (curElement.GetAttribute("className").ToString() == "example")
{
MessageBox.Show(curElement.GetAttribute("InnerText")); // Do something you want
}
}