Python Machine Learning Blueprints - Second Edition
by Alexander Combs, Saurabh Chhajed, Michael Roman
Creating a link
Now, remarkably, we have everything we need to begin our airline fare scraping, with one exception: we need the URL. For this exercise, I'm going to focus on flights leaving from NYC and flying to Europe. Since we don't want to pull down massive quantities of data and risk being blocked, we are going to just pull data for non-stop flights that depart on Saturday and return on the following Saturday. You are, of course, free to change this to whatever fares you'd like to target, but we'll use this for our sample project.
The next step is to fill out the form in Google Flights. Make sure to choose a future date. Once you have input your data and hit Search, copy the URL string from your browser bar, as seen in the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access