This project demonstrates the implementation of a Book Scraper web application using Flask and BeautifulSoup to scrape, filter, and display book data from a fictional website.
app.py
: Contains the main Flask application setup, routes, and business logic.templates/
: Holds the HTML templates for rendering the search form and displaying search results.
- Flask: A lightweight WSGI (Web Server Gateway Interface) web application framework used to build the web server.
- BeautifulSoup: A library for parsing HTML and XML documents, used extensively in this project for web scraping.
- Python: The primary programming language for the project.
- Requests: A Python HTTP library used to make requests to the target website for web scraping.
- CSV: Python's built-in library for handling CSV file operations.
- Python 3.x: Ensure you have Python installed, as it's required to run the Flask application and perform web scraping.
- pip: Python's package installer, needed to install dependencies.
- Clone the repository:
git clone https://github.com/ahmadrafidev/books-scraper.git
- Navigate to the project directory:
cd books-scraper
- Set up a virtual environment (optional but recommended):
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
- Install the required Python packages:
pip install Flask requests beautifulsoup4
- Run the Flask application:
flask run
The above steps will set up the environment and start the Flask server, making the application accessible from a web browser at the default address http://127.0.0.1:5000/.
Have fun!