This Flask application scrapes product data from a Shopify store and exports it to a CSV file.
- Fetches product URLs from the Shopify sitemap.
- Extracts product data including variants and images.
- Exports the data to a CSV file.
- Python 3.x
- Flask
- requests
- beautifulsoup4
- pandas
- lxml
- Clone the repository: git clone https://github.com/damidina/shopify-product-scraper.git
cd shopify-product-scraper
- Install the required packages:
sh
pip install -r requirements.txt
- Run the Flask app:
sh
python app.py
-
Open your web browser and go to
http://127.0.0.1:5000/. -
Enter the Shopify store URL in the form and click "Scrape".
-
The application will process the product data and generate a CSV file named
shopify_products.csv.
-
Check the Terminal Logs: Look for any error messages or warnings in the terminal where you run the Flask app.
-
Verify the Shopify URL: Ensure the Shopify URL you are entering in the form is correct and accessible.
-
Inspect the Sitemap: Manually check the sitemap URL (e.g.,
https://your-shopify-store.myshopify.com/sitemap.xml) to ensure it contains product URLs. -
Check Product JSON URLs: Manually check a few product JSON URLs (e.g.,
https://your-shopify-store.myshopify.com/products/product-handle.json) to ensure they return valid product data.
This project is licensed under the MIT License.