Adigen
Client
- Joined
- Jul 28, 2014
- Messages
- 825
- Reaction score
- 654
- Points
- 93
Этот код поидее должен брать видимые ссылки. Подскажите как полученные ссылки записать в список?Code:string domain = new Uri(instance.ActiveTab.URL).Host; int body_width = instance.ActiveTab.MainBody.Width; int body_height = instance.ActiveTab.MainBody.Height; var links = instance.ActiveTab.FindElementsByAttribute("a", "href", Regex.Escape(domain)+".{3,}", "regexp").Elements .Where(e=>(e.Width > 0 && e.Height > 0 && Math.Abs(int.Parse(e.GetAttribute("leftinbrowser"))) < body_width && Math.Abs(int.Parse(e.GetAttribute("topinbrowser"))) < body_height)).Distinct().Shuffle().ToList();
C#:
project.Lists["List1"].AddRange(links.Select(a => a.GetAttribute("href")));