public async static Task<Uri> GetFaviconUri(Uri page) { var doc = await new HtmlAgilityPack.HtmlWeb().LoadFromWebAsync(page.AbsoluteUri); var href = doc.DocumentNode.Descendants("link") .Where(n => n.Attributes.Any(a => a.Name == "rel" && a.Value == "icon" || a.Value == "shortcut icon")) .FirstOrDefault()?.GetAttributeValue("href", null); return href == null ? null : new Uri(page, href); }