🚀 Now you can scrape any website and chat with it to understand its content! Dive into the website's details, ask questions, and get instant insights—all in a friendly and conversational manner. 🌐🤖
-
Website Content Extraction:
- Seamlessly handles dynamic content loading with Selenium and BeautifulSoup.
- Extracts headers, paragraphs, and main content intelligently.
-
Interactive Chat Interface:
- Chat with the extracted website content using OpenAI GPT-3.5.
- Enjoy natural, friendly conversations with a touch of humour and emojis. 😄
-
Error Handling:
- Validates URLs to avoid any mishaps.
- Gracefully manages API errors and extraction failures.
- Provides clear and helpful prompts for invalid inputs.
-
Navigation Commands:
new
: Switch to a new website effortlessly.exit
: End the chatbot session whenever you want.
-
Clone the Repository:
git clone https://github.com/yourusername/website-chatbot.git cd website-chatbot
-
Set Up a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up OpenAI API Key:
- Create a
.env
file in the root directory. - Add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
- Create a
-
Run the Script:
python website_chatbot.py
-
Interact with the Chatbot:
- Enter a valid website URL (e.g.,
https://example.com
). - Ask questions like: "What is this website about?" or "What are its main headings?"
- Switch websites easily by typing
new
. - Exit the chatbot anytime with
exit
.
- Enter a valid website URL (e.g.,
🎉 Pro Tip: Get creative with your questions! The chatbot is here to help you dig deep into website content.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Feel free to open issues or submit pull requests.
For questions or support, contact: Aditya Tiwari