private void CreatePage(string url, uint maxStep, List <string> analyzedUrls, uint stepCount = 0) { if (stepCount > maxStep) { return; } if (!DomainValidator.IsValid(_domainLimit, url, _rootUrl)) { return; } if (_isVerbose) { Console.WriteLine($"Analyzing url: {url}"); } SafeRunner.Run(() => _directoryWrapper.Create(url)); var html = SafeRunner.Run(() => _reader.Read(url)); SafeRunner.Run(() => _fileWrapper.CreateHtmlFile(url, html)); var doc = _parser.Parse(html); CopyFiles(doc, url); analyzedUrls.Add(url); var links = GetLinks(doc, url); foreach (var link in links) { var linkUrl = PathConverter.ToUrl(url, link.Href); if (analyzedUrls.Contains(linkUrl)) { continue; } CreatePage(linkUrl, maxStep, analyzedUrls, stepCount + 1); } }