Example #1
0
        public AsinPageData ParseAsinPage(string content)
        {
            var doc = CreateHtmlDoccument(content);



            AsinPageData page = new AsinPageData
                                (
                productTitle: GetProductTitle(doc),
                reviews: GetReviews(doc),
                nextPage: GetNextpageUri(doc)
                                );

            return(page);
        }
Example #2
0
        public async Task AmazonService_GetPages()
        {
            // Arrange
            AmazonWebScraper.AmazonScraper amazonService = AmazonModule.Create <AmazonWebScraper.AmazonScraper>();

            // Act
            AsinPageData page = await amazonService.GetPageDataFromAsinAsync("B082XY23D5");

            AsinPageData page2 = await amazonService.GetPageDataFromUriAsync(page.NextPageUri);


            // Assert
            Assert.NotNull(page);
            Assert.NotEqual(page.NextPageUri.ToString(), page2.NextPageUri.ToString());
        }
Example #3
0
        public void AddCustomerReviews(string asinCode, AsinPageData pageData)
        {
            var item = CustomerReviewsPageDictionary.GetOrAdd(asinCode, new List <AsinPageData>());

            item.Add(pageData);
        }