예제 #1
0
		private async Task<CssUsageInfo[]> AnalyzeExternalStyles(Uri pageUrl, HtmlDocument html)
		{
			var cssUrls = html
				.GetExternalCssUrls()
				.Select(href => UrlHelper.CreateFromHref(pageUrl, href))
				.ToList();



			var tasks = cssUrls.Select(cssUrl => Task.Run(async () =>
			{
				var stylesheet = await _stylesheets.GetOrDownload(cssUrl);

				return AnalyzeCssStylesheet(stylesheet, html);

			})).ToList();

			return await Task.WhenAll(tasks);

		}