A Next.js application to scrape product details from the popular e-commerce site Daraz, track price changes, and notify users when specific conditions are met.
- Description
- Features
- Technologies Used
- Prerequisites
- Installation
- Usage
- Website
- Contributing
- Authors and Acknowledgments
- License
DarazScrapper is a web application built with Next.js that scrapes product details from Daraz, records the highest and lowest prices, and provides a notification system for price changes. It uses MongoDB for data storage and Bright Data for efficient scraping.
- Price Tracking: Records highest and lowest prices for products over time.
- Notification System: Sends alerts when price drops below a set threshold.
- Web Scraping: Extracts product details like name, price, and rating.
- Cron Jobs: Schedules scraping tasks to run periodically.
- Next.js: React framework for server-side rendering.
- MongoDB: NoSQL database for storing scraped data.
- Bright Data: Data collection and web scraping tool.
- Node.js: Server-side environment.
- Tailwind CSS: Utility-first CSS framework.
Before installing, make sure you have the following:
- Node.js v14 or higher
- npm or Yarn
- MongoDB instance
-
Clone the repository:
git clone https://github.com/Eemayas/Daraz_Scraper.git cd Daraz_Scraper
-
Install dependencies:
npm install # or yarn install
-
Set up environment variables: Create a
.env.local
file with the following variables:MONGODB_URI=<your-mongodb-uri> BRIGHT_DATA_API_KEY=<your-bright-data-api-key> BRIGHT_DATA_USERNAME=<bright-data-username> BRIGHT_DATA_PASSWORD=<bright-data-password> EMAIL_USER=<email-address> EMAIL_PASSWORD=<email-password>
-
Start the development server:
npm run dev # or yarn dev
-
Add the URL of the product you want to scrape:
const productUrl = "https://www.daraz.com.np/products/example-product"; addProductToScraper(productUrl);
-
The app will automatically track the price and notify you of any significant changes.
You can view the live demo of DarazScrapper at https://daraz-scraper.vercel.app/.
Contributions are welcome! Please fork the repository and submit a pull request.
- Prashant Manandhar - Eemayas
- Email: prashantmanandhar2002@gmail.com
- Website: https://www.manandharprashant.com.np/
This project is licensed under the MIT License.