Skip to content

moomoein/digikala-product-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python License Stars

Terminal demo showing the scraper extracting Digikala products

🧠 Digikala Product Scraper (WooCommerce Ready)

A professional modular Python scraper for Digikala API that extracts all product details — including variants, prices, images, attributes, and categories — into WooCommerce-ready JSON.

🇮🇷 پشتیبانی کامل از ساختار محصولات دیجی‌کالا (ساده و متغیر)، با تنظیمات قابل سفارشی‌سازی و ساختار ماژولار.


✨ Features

✅ Supports both Simple and Variable products
✅ Extracts prices, variants, categories, attributes, tags, and images
✅ Configurable via config.py — enable/disable gallery, debug logs, or image download
✅ Saves output as clean, WooCommerce-compatible JSON
✅ Built with modular structure (utils/ folder) for reusability and extension
✅ Supports Persian content natively (UTF-8 output)


🛠️ Installation

git clone https://github.com/moomoein/digikala-product-scraper.git
cd digikala-product-scraper
pip install requests

⚙️ Configuration

Edit the config.py file:

SEARCH_KEYWORD = "گوشی موبایل"
PAGES_TO_SCRAPE = 2
ENABLE_GALLERY = True
ENABLE_IMAGE_DOWNLOAD = False
ENABLE_DEBUG_LOGS = False

🚀 Usage

python scraper_final.py

Results will be saved in:

output/<OUTPUT_NAME>/
    ├── <OUTPUT_NAME>_products.json
    └── images/

📦 Example Output (WooCommerce JSON)

{
  "sku": "DKP-12345",
  "type": "variable",
  "name": "گوشی موبایل سامسونگ مدل Galaxy A54",
  "regular_price": 21500000.0,
  "sale_price": 19800000.0,
  "attributes": [...],
  "variations": [...],
  "categories": [{"name": "موبایل"}]
}

🧩 Folder Structure

digikala-product-scraper/
├── config.py          # Configuration & options
├── scraper_final.py   # Main entry point
└── utils/
    ├── fetcher.py     # API requests
    ├── parser.py      # JSON parsing & data extraction
    └── downloader.py  # Image & file handling

🌍 Use Cases

  • 🔄 Importing Digikala products into WooCommerce / WordPress
  • 📊 Competitive product analysis or dataset creation
  • 🧠 AI/ML product recommendation training datasets
  • 💾 Backup of Digikala product catalogs

📜 License

MIT License — feel free to use, modify, or contribute.


🤝 Contribute

Pull requests are welcome!
If you find this project useful, don't forget to ⭐ Star the repo and share it with other developers!

📬 Contact

Created by @moomoein — feel free to reach out for collaboration.

About

🧠 Digikala Scraper | Modular Python script to export Digikala products to WooCommerce-ready JSON — perfect for eCommerce, datasets, and automation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages