Easily extract product details from a WooCommerce-based website leveraging the power of Selenium and BeautifulSoup.
🚀 Getting Started
🛠️ Prerequisites
Python: This script is designed for Python 3.x. pip: Ensure pip is installed to manage Python packages. Google Chrome: The script uses the ChromeDriver, so ensure you have Chrome installed.
🔧 Installation
Virtual Environment: Maintain a clean Python environment by setting up a virtual environment.
First, install virtualenv if it's not yet installed:
bash Copy code pip install virtualenv Navigate to your project's directory:
bash Copy code cd path/to/your/directory Create and activate the virtual environment:
bash Copy code virtualenv venv source venv/bin/activate # On Windows use: .\venv\Scripts\activate Install Required Libraries: With the virtual environment activated, install the required packages:
bash Copy code pip install beautifulsoup4 pandas selenium webdriver_manager 📜 Running the Script URLs Configuration: Ensure that the urls list in the script contains the WooCommerce website URLs you wish to scrape.
Execute the Script:
Navigate to the script's directory (if not already):
bash Copy code cd path/to/your/script/directory Run the script:
bash Copy code python script_name.py 📌 Don't forget to replace script_name.py with your actual script's filename.
Output: After successful execution, the extracted product details will be saved in a file named woocommerce_data.csv.
🧹 Cleanup Once done, deactivate your virtual environment:
bash Copy code deactivate 🤝 Contributing Any enhancements, optimizations, or contributions are most welcome! If you make a contribution, don't forget to give yourself a shoutout in the authors or contributors section.
👤 Authors Your Name - LinkedIn Profile https://www.linkedin.com/in/owais-shaikh-6433aa181/
#WebScraping , #WooCommerce , #Selenium , #Python ,