Beispiel #1
0
        public virtual PaginatedPage ScrapePaginatedPage(
            IDocument document,
            string listItemsSelector,
            IEnumerable <PropertySettings> properties)
        {
            var listProperties = base.ScrapeListProperties(
                document,
                this.GetSettings.ListItemsSelector,
                this.GetSettings.Properties);
            var pagination = this.ScrapePagination(
                document,
                this.GetSettings);

            var paginatedPage = new PaginatedPage
            {
                Url            = document.Url,
                ListProperties = listProperties,
                Pagination     = pagination
            };
            var e = new PaginatedPageScrapedEventArgs
            {
                Url           = document.Url,
                Settings      = this.GetSettings,
                PaginatedPage = paginatedPage
            };

            this.PaginatedPageScraped?.Invoke(this, e);
            return(paginatedPage);
        }
Beispiel #2
0
        public virtual bool ResolveNextPageCondition(PaginatedPage paginatedPage)
        {
            if (paginatedPage.Pagination.HasNextPage)
            {
                return(true);
            }
            var currentPage = this.ResolveCurrentPage(paginatedPage.Pagination.CurrentPage);

            if (paginatedPage.Pagination.HasPage(currentPage))
            {
                return(true);
            }

            return(false);
        }