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); }
Showing posts with label uwp. Show all posts
Showing posts with label uwp. Show all posts
May 18, 2016
Get a site's Favicon uri
Using HtmlAgilityPack NuGet package (Ms-Pl license):
Jan 30, 2016
UWP: where are my solution's Content files?
Package.Current.InstalledLocation
Subscribe to:
Posts (Atom)