public AsinPageData ParseAsinPage(string content) { var doc = CreateHtmlDoccument(content); AsinPageData page = new AsinPageData ( productTitle: GetProductTitle(doc), reviews: GetReviews(doc), nextPage: GetNextpageUri(doc) ); return(page); }
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()); }
public void AddCustomerReviews(string asinCode, AsinPageData pageData) { var item = CustomerReviewsPageDictionary.GetOrAdd(asinCode, new List <AsinPageData>()); item.Add(pageData); }