示例#1
0
        private void ProccessPage()
        {
            string url = _repo.GetNextUrl();

            if (url == null)
            {
                Stop();
                return;
            }

            string html = _browser.Browse(url);

            if (IsInvalidPage(html))
            {
                return;
            }

            if (_checker.IsSearched(url, html))
            {
                _repo.AddFound(url);
                OnFound(new FoundEventArgs(url));
            }
            else
            {
                _repo.AddVisited(url);
            }

            _repo.Enqueue(_extractor.ExtractUrls(html, url));
        }