Utilize the power of the langchain web extraction library in tandem with OpenAI's GPT models to effortlessly extract product details from WooCommerce websites.
🚀 Getting Started
🛠️ Prerequisites Python: The script is compatible with Python 3.x. pip: To manage the Python packages, ensure pip is installed.
🔧 Installation
Virtual Environment: Before we proceed, it's recommended to set up a Python virtual environment to keep things clean and organized.
First, if you haven't already, install virtualenv:
bash Copy code pip install virtualenv Navigate to your project directory:
bash Copy code cd path/to/your/directory Create a new virtual environment:
bash Copy code virtualenv venv Activate it:
On Windows:
bash Copy code .\venv\Scripts\activate On macOS and Linux:
bash Copy code source venv/bin/activate Install Necessary Libraries: With your virtual environment activated, install the required packages:
bash Copy code pip install beautifulsoup4 lxml openai langchain 📜 Running the Script API Key Setup: Before executing, ensure you've added your OpenAI API key in the openai_api_key variable inside the script.
Execution:
Navigate (if you haven't already) to the script's directory:
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 name.
Results: If all goes well, the product details will be saved in a file named new.csv.
🧹 Cleanup Once done, it's a good practice to deactivate your virtual environment:
bash Copy code deactivate 🤝 Contributing Feel free to make enhancements, and if you make a contribution, do give a shoutout!
👤 Authors Owais Shaikh - LinkedIn Profilehttps://www.linkedin.com/in/owais-shaikh-6433aa181/