Comic book collectors can face challenges in determining the best value for their purchases due to varying page counts in volumes.
A TypeScript program is developed to calculate the price per page, assisting collectors in making informed buying decisions.
The project focuses on scraping comic book deals from the Wildberries e-commerce platform, with modular code structure for adaptability to other online retailers.
A data model is defined using TypeScript interfaces to represent comic book properties and calculate the cost per page.
Browser lifecycle management is handled using Puppeteer, with functions like withBrowser for browser instance management.
Page lifecycle management is implemented through functions like makeWithPage, standardizing page configuration for web scraping operations.
Scraping search results involves handling infinite scroll pagination, extracting product links, and focusing on the most relevant results for further processing.
Comic book details like title, price, and page count are extracted using Puppeteer's evaluation methods in the scrapeBookPage function.
The main function orchestrates the scraping process by constructing search URLs, extracting product links, processing them in batches, and sorting comics based on price per page.
The TypeScript application offers a practical solution for comic book collectors to make data-driven purchasing decisions and maximize the value of their collections.