A simple Python command-line application that helps users discover books by genre.
The program scrapes book data from the Books to Scrape website, allows users to choose a category, and provides random book recommendations along with descriptions.
- Scrapes book categories dynamically
- Lets users select a preferred genre
- Fetches books from the selected category
- Generates random book recommendations
- Displays book descriptions
- Allows users to request another recommendation
- Built using Python, Requests, and BeautifulSoup
- Python
- Requests
- BeautifulSoup4
- Random
Clone the repository:
git clone <your-repository-url>
cd <repository-name>Install dependencies:
pip install requests beautifulsoup4 lxmlRun the script:
python Bs4.pyChoose a category from the displayed list and receive book recommendations based on your selection.
1. Travel
2. Mystery
3. Historical Fiction
...
Enter the number corresponding to your favorite genre: 2
==================================================
Random Recommendation
==================================================
Title : Sharp Objects
Description:
Fresh from a brief stay at a psych hospital...
Do you want another recommendation? (y/n):
While building this project, I practiced:
- Web scraping with BeautifulSoup
- Sending HTTP requests with Requests
- Parsing HTML data
- Working with lists and loops
- Handling user input
- Building interactive command-line applications
- Store book data using SQLite
- Add ratings and prices to recommendations
- Support multiple recommendation strategies
- Build a Telegram bot version
- Create a web interface using Flask
This project is intended for educational purposes and uses data from the Books to Scrape practice website.
Abhinav Prakash