Example #1
0
        /// <summary>获取指定地址的Html,分析所有超链接</summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public Link[] GetLinks(String url)
        {
            var html = GetHtml(url);

            if (html.IsNullOrWhiteSpace())
            {
                return(new Link[0]);
            }

            return(Link.Parse(html, url));
        }
Example #2
0
        /// <summary>获取指定地址的Html,分析所有超链接</summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public Link[] GetLinks(String url)
        {
            var html = GetHtml(url);

            if (html.IsNullOrWhiteSpace())
            {
                return(Array.Empty <Link>());
            }

            return(Link.Parse(html, url));
        }