Esempio n. 1
0
		public async Task AnalyzeWebPages(Options options)
		{
			Cleanup(options);

			
			var tasks = options.Urls
				.Select(UrlHelper.CreateInvariantToScheme)
				.Select(uri => Task.Run(async () =>
				{

					var analyzer = new PageAnalyzer(_cssStylesheets);
					try
					{
						var htmlDocument = await GetHtml(uri);

						var analysisResult = await analyzer.Analyze(uri, htmlDocument);

						WriteResults(analysisResult, options);
					}
					catch (UnsupportedContentTypeException ex)
					{
						
					}

				})).ToList();

			await Task.WhenAll(tasks);
		}
Esempio n. 2
0
		private async Task<PageAnalysisResult> GetPageAnalysis(Uri pageUrl)
		{
			var analyzer = new PageAnalyzer(_cssStylesheets);

			var htmlDocument = await GetHtml(pageUrl);
			var analysisResult = await analyzer.Analyze(pageUrl, htmlDocument);
			return analysisResult;
		}