- Based on Amazon Cell Phones Reviews dataset project
- Scrape multiple categories and saves into one and separate files
- Scrapes basic metadata with ratings and reviews
- Use multiple Puppeteer pages as workers
- Configurable timeout for rate limits cooldowns (read more below)
Due to Lazada servers limits unusual requests, this scraper only utilize one worker to scrape search results, while the review scraping process is set to five workers with a five second timeout.
More detailed documentation on this issue coming soon...
You can download pre-scraped datasets at Kaggle (Lazada Indonesian Reviews).
puppeteerfor browser-based scrapingprettierfor formatting source codests-nodefor running TypeScript scripts
- Make sure the dependencies are downloaded by running
npm installoryarn. - Copy
config.default.ts(this file is ignored with git) toconfig.tsand customize config variables onconfig.ts.
- Open the project directory in Visual Studio Code.
- Select and execute Scrape Search Results in the launch options on the Debug tab (exported to
./data/yyyymmdd-category-items.csvand./data/yyyymmdd-items.csv). - Then select and execute Scrape Item Reviews (exported to
./data/yyyymmdd-category-reviews.csvand./data/yyyymmdd-reviews.csv).
- Run
npm run scrape:itemsoryarn scrape:itemsfirst to scrape initial item results (exported to./data/yyyymmdd-category-items.csvand./data/yyyymmdd-items.csv). - Then run
npm run scrape:reviewsoryarn scrape:reviewsto scrape item reviews (exported to./data/yyyymmdd-category-reviews.csvand./data/yyyymmdd-reviews.csv).
-
scrape:itemsScrapes and saves entry results for review scraping.
-
scrape:reviewsScrapes and saves entry reviews based on
scrape:itemsdata. -
formatFormat all
.tsfiles. -
format:dataFormat
.jsonfiles in/data.
