DEV Community

Sai Vishwa B
Sai Vishwa B

Posted on

Dive into the Top 25 Movies with a Flask App: From Classics to Modern Blockbusters!

Ever found yourself endlessly scrolling through IMDB, trying to decide which movie to watch? What if you could just type in a year and instantly get the top 25 movies? Well, now you can! Welcome to the Top 25 Movies Flask App—a fun and simple way to explore the best movies from any year. 🎬

Check the live page: https://top25moviez-kp5g.onrender.com/
Github Repo: https://github.com/SaiVishwa021/Top25Movies

What is Web Scraping?

Before we dive into the app, let's talk a bit about web scraping. Imagine you're on a treasure hunt, but instead of gold, you're after data hidden within web pages. Web scraping is just that—a technique to fetch and extract data from websites, simulating human browsing behavior. It’s like being a data detective! 🕵️‍♂️

How the Top 25 Movies Flask App Works

Here’s a sneak peek into how the magic happens behind the scenes:

  1. Send HTTP Request: The app sends an HTTP GET request to IMDB to fetch the top movies for a specific year.

  2. Parse HTML Content: Once the response is received, BeautifulSoup steps in. This powerful library parses the HTML, allowing us to navigate through the web page’s structure.

  3. Extract Movie Information: We then hunt for movie elements within the HTML, grabbing juicy details like movie titles, ranks, and more.

  4. Save Data: After collecting all the movie info, it’s saved neatly into a CSV file in the dataset folder. Now, you’ve got a handy reference list of top movies!

Features You’ll Love

  • Scrape movie data from IMDB from 1950 onwards. Want to explore the classics or check out modern blockbusters? We’ve got you covered.
  • Save the movie info to your very own dataset folder for further analysis or just for fun.
  • Simple and intuitive user interface. No need to be a tech wizard; it’s user-friendly!

Installation: Get the App Running in No Time

Ready to explore the top movies? Here’s how to get started:

  1. Clone the repository:
git clone https://github.com/SaiVishwa021/Top25Movies.git
Enter fullscreen mode Exit fullscreen mode
  1. Install the Required Packages

To get started, install the necessary packages by running the following command:

pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode
  1. Run the Flask application:
python app.py
Enter fullscreen mode Exit fullscreen mode
  1. Example:

To fetch the top 25 movies for the year 2023, just enter 2023 in the input field and click "Submit". The app will not only display the top 25 movies but also save the data to dataset/top_25_movies_2023.csv. 🎉

Feel free to share your thoughts or add more features to make this app even cooler. Happy movie hunting! 🍿

Top comments (0)