Web Scraping Google Flights With Python’s Selenium and BeautifulSoup4

Jaemin Lee
7 min readApr 6, 2024
Photo by JESHOOTS.COM on Unsplash

Introduction

This article delves into the practicality of web scraping Google Flights using Selenium and BeautifulSoup4 in Python. While Google Flights is indeed user-friendly and feature-rich, there are practical reasons to consider this approach, such as machine learning on flight price trends.
Living away from family and close ones, I frequently fly from where I live to the same destination and back. Personally, I always forget to book flights and end up paying extra or booking on dates that don’t work perfectly with my schedule. Being forgetful, I decided to have Python look at my prices and provide an easy way to see if I was getting a reasonable price. Python also notified me when these prices were available.
Taking a step back, in this article, I’ll cover the data collection process of my project, which involves scraping Google Flights for the data I need. I’ll also blog about the other parts of the project as they are completed. This article is not necessarily meant to be a step-by-step guide but rather my thought process on the project and how I decided to use some of the tools I am familiar with.

Background Information

--

--

Jaemin Lee

Master's in CS with a focus on Data Science and ML. Enthusiast in rock climbing, hiking, and powerlifting. Sharing tech insights and adventures.