Image Scraping Web App with MongoDB Integration

This is a Python web application for scraping images from Google Images and storing them in a MongoDB database. The application is built using the Flask web framework and utilizes the Beautiful Soup library for web scraping.

Prerequisites

Before running this application, make sure you have the following prerequisites installed:

  • Python 3
  • Flask
  • Beautiful Soup (bs4)
  • Requests
  • pymongo
  • MongoDB (you will need to set up a MongoDB database for image storage)

Installation

  1. Clone this repository or download the source code.

  2. Install the required Python libraries using pip:

    pip install Flask beautifulsoup4 requests pymongo
    
  3. Make sure you have a MongoDB database set up and adjust the connection details in the code accordingly.

  4. Run the application using the following command:

    python app.py
    

Notes

  • The application uses a fake user agent to avoid being blocked by Google. However, this is not a guaranteed solution, and Google may still block requests.

  • Remember to handle exceptions and errors in the code to ensure robustness.

  • This is a basic example of web scraping and image storage. You can extend it by adding more features and error handling as needed.