This Python project scrapes book data from Books to Scrape and automatically submits it into a Google Form. It also includes optional data analytics for visualizing the scraped data.
- Scrapes book information from multiple pages:
- Title
- URL
- Price
- Rating
- Stock availability
- Automatically submits the data to a Google Form
- Optional analytics using Matplotlib to visualize average price by rating
- Users can use their own Google Form with 5 text input fields:
- Book Title
- Book URL
- Book Price
- Book Rating
- Book Stock
git clone https://github.com/MPALONDON/BeautifulSoup-Selenium-Automation.gitcd <your-project-folder>It’s recommended to use a virtual environment:
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Mac/Linux
pip install -r requirements.txtIf you want to use your own Google Form:
- Create a Google Form with 5 text inputs in this order:
- Book Title
- Book URL
- Book Price
- Book Rating
- Book Stock
- Copy the form URL.
- Create a
.envfile in the project root with:
GOOGLE_FORM_URL="YOUR_GOOGLE_FORM_URL_HERE"
If .env is not provided, the program will use the default form URL.
python main.py- The program will ask how many pages to scrape.
- It will scrape the data from the specified number of pages and submit it to your Google Form.
- Optional analytics will be displayed automatically before submission.
The program creates a simple bar chart showing average book price by rating using Matplotlib. This allows you to quickly visualize trends in the scraped data.
- Currently uses
time.sleep()to wait for pages to load; WebDriverWait is not implemented. - Make sure your Google Form is open to accept responses.
- Only works for Books to Scrape structure.