DEV Community

Mumtaz Ali
Mumtaz Ali

Posted on

🛒 Amazon Scraper

Image description

Overview
Amazon Scraper is a Python-based project designed to extract product data from Amazon, such as titles, prices, reviews, and images. It features a Flask backend for handling data processing and a React frontend for displaying results. The scraper is powered by BeautifulSoup to efficiently gather data.

🚀 Features
Scrape Amazon product details using search queries.
Export data to JSON and CSV formats.
A Flask API to serve scraped data.
A React.js frontend for querying and displaying product data.

🏗️ Project Structure

amazon_scraper/
├── backend/
│   ├── app.py               # Flask application
│   ├── scraper.py           # Scraping logic
│   ├── utils.py             # Utility functions
│   ├── user_queries.json    # User input queries
│   ├── requirements.txt     # Backend dependencies
│   ├── output/              # Scraped data storage
│   └── vercel.json          # Backend deployment config
├── frontend/
│   ├── public/              # Static frontend files
│   ├── src/                 # React.js source files
│   ├── package.json         # Frontend dependencies
│   ├── .env                 # Environment variables
│   └── build/               # Production-ready frontend
Enter fullscreen mode Exit fullscreen mode

📦 Installation
Backend Setup
Clone the repository:

git clone https://github.com/engrmumtazali0112/python-script-amazon-scrape.git
cd amazon_scraper/backend
Enter fullscreen mode Exit fullscreen mode

Install dependencies:

pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Run the Flask server:

python app.py
Enter fullscreen mode Exit fullscreen mode

Access the backend at: http://127.0.0.1:5000

Frontend Setup
Navigate to the frontend directory:

cd ../frontend
Enter fullscreen mode Exit fullscreen mode

Install dependencies:

npm install
Enter fullscreen mode Exit fullscreen mode

Start the development server:

npm start
Enter fullscreen mode Exit fullscreen mode

🌐 Deployment
Backend Deployment
Ensure vercel.json is correctly configured.
Deploy to Vercel:

vercel --prod
Enter fullscreen mode Exit fullscreen mode

Frontend Deployment
Build the React app:

npm run build
Enter fullscreen mode Exit fullscreen mode

Deploy to Vercel:

vercel --prod
Enter fullscreen mode Exit fullscreen mode

🔗 Dependencies
Python 3.12
Flask
BeautifulSoup
React.js
Node.js
📜 License
This project is licensed under the MIT License.

📌 Follow Us

Made with ❤️ by Mumtaz Ali

Happy Coding! ✨

Top comments (0)