예제 #1
0
        protected virtual IEnumerable <string> FindLinks(IHtmlDocument document)
        {
            document.ResolveUriToAbsoluate();

            foreach (var href in document.Find("a[href]").Select(element => element.Attribute("href").Value()))
            {
                var uri = new UriBuilder(new Uri(document.DocumentUri, href));
                uri.Fragment = null;
                yield return(uri.Uri.AbsoluteUri);
            }
        }