コード例 #1
0
        private Page fetchNextPage(BackQueue backQueue, Uri currentUrl)
        {
            String host = currentUrl.GetLeftPart(UriPartial.Authority);

            while (backQueue.EnoughTimeHasPassed(host, DateTime.Now) == false)
            {
                Thread.Yield();
            }

            Page newPage = new Page(currentUrl);

            parser.AddHtmlToPage(newPage);
            if (String.IsNullOrEmpty(newPage.Html))
            {
                return(null);
            }

            parser.AddBodyToPage(newPage);
            if (String.IsNullOrEmpty(newPage.SiteText))
            {
                return(null);
            }

            parser.AddPathsToPage(newPage);
            return(newPage);
        }