A Scrapy-based project for extracting product data from meghdadit.com
and storing it in a MongoDB database.
- Crawls all product categories and paginated pages
- Extracts:
- Product title
- Product ID
- URL
- Categories
- Currency
- Availability status
- Saves items to MongoDB using a dedicated pipeline
- Fully respects
robots.txt
- Python 3.8+
- MongoDB (local or remote)
- Dependencies listed in
requirements.txt
git clone https://github.com/amirhamidi2001/Meghdadit-Scrapy.git
cd Meghdadit-Scrapy
pip install -r requirements.txtMake sure your MongoDB service is running before starting the spider.
Edit the following file to adjust your MongoDB connection settings:
meghdadit/meghdadit/settings.py
MONGODB_URI = "mongodb://localhost:27017"
MONGODB_DATABASE = "meghdadit"
MONGODB_COLLECTION = "items"cd meghdadit
scrapy crawl meghdaditThe scraped data will be stored in your MongoDB database
under the configured database and collection names.
.
├── LICENSE
├── meghdadit/
│ ├── meghdadit/
│ │ ├── __init__.py
│ │ ├── items.py
│ │ ├── middlewares.py
│ │ ├── pipelines.py
│ │ ├── settings.py
│ │ └── spiders/
│ │ ├── meghdadit_spider.py
│ │ ├── plugins.py
│ │ └── __init__.py
│ └── scrapy.cfg
├── requirements.txt
└── README.md
The MongoDB pipeline is implemented in:
meghdadit/meghdadit/pipelines.py
You can customize how items are processed or inserted into MongoDB here.
This project is licensed under the MIT License.
See the LICENSE file for details.
Amir Hamidi
GitHub: amirhamidi2001