Ejemplo n.º 1
0
        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);
        }