public HTMLUListElement GetUList(string tagName, string attName, string attValue) { HTMLDocument document = ((HTMLDocument)IE.Document); IHTMLElement el = null; IHTMLElementCollection tags = document.getElementsByTagName(tagName); IEnumerator enumerator = tags.GetEnumerator(); while (enumerator.MoveNext()) { HTMLUListElement element = (HTMLUListElement)enumerator.Current; if (element.getAttributeNode(attName) != null) // are class { if (element.getAttributeNode(attName).nodeValue != null && element.getAttributeNode(attName).nodeValue.ToString() == attValue) { ///MessageBox.Show("found the element"); return(element); } } } return(null); }