Пример #1
0
        private List <string> GetDiscussionUrls(IE ie, string siteUrl)
        {
            List <string> discussions = new List <string>();

            ie.GoTo(siteUrl);
            ie.WaitForComplete();

            bool done = false;

            ie.Link(Find.ById("discussionTab")).Click();
            while (!done)
            {
                ie.WaitForComplete();
                foreach (var div in ie.Divs)
                {
                    if (div.ClassName == "post_content")
                    {
                        discussions.Add(div.Link(Find.First()).Url);
                    }
                }

                var pag  = ie.List(Find.ById("discussion_pagination"));
                var link = pag.Link(Find.ByText("Next"));
                if (link.Exists)
                {
                    link.Click();
                }
                else
                {
                    done = true;
                }
            }

            return(discussions);
        }
 public StaticElementFinder(DomContainer domcontainer, INativeElement nativeElement) : base(CreateTagList(nativeElement), Find.First())
 {
     _domContainer  = domcontainer;
     _nativeElement = nativeElement;
 }
Пример #3
0
 public T First()
 {
     return((T)FindFirst(Find.First()));
 }
Пример #4
0
 public Element First()
 {
     return(FindFirst(Find.First()));
 }