02 June 2017

Creating Flight Check-in Bot: Analyze the Website


How often do you fly? Aren’t you tired of providing your personal information every time you’re doing online check-in? Did you notice it takes your precious time and may be stressful, especially if the check-in system is not very friendly?

What if you could check-in your flight by chatting with a friend through the Messenger?

In this series of articles, you will learn how to make it possible with one small exception; your friend will be a bot, a program created by you. One of the bot’s parts will be responsible for talking with people and the other one for talking with the online check-in system.

You will learn how to create both parts, but before you start coding, you need to analyse the airline’s website, detect what options does it give and discover how you can easily navigate through the online check-in system.

Ok, let’s find out how does the world of airlines’ websites work.

“Knock, knock… Know your enemy.”

Airlines’ online check-in systems are not open systems – they don’t provide any API, they don’t offer any test or demo system, they often don’t even provide any user manual.

The only way to find out how the online check-in system behaves and what options does it offer is to buy a plane ticket and wait for the flight. Well, it’s no big deal. The most of the airlines allow to check-in online not sooner than about 24 hours before the flight, like American Airlines, Delta Air Lines, Air France or Lufthansa. There are also airlines which allow you to enter their system even 30 days before the flight, like easyJet, Ryanair or Wizz Air.

Don’t worry, if you can’t check-in yet, it doesn’t mean you have to sit idle. Start browsing the airline’s page, play with the ticket reservation system or change a seat during the process, if possible. It’s very likely the other parts of the system were developed by the same team which follows the same standards or use the same components, like plane seat selection map.

What’s more, you can play with the “login” to the check-in system to find out what information is required to start the check-in procedure or detect if there is any form of validation and how it is processed.

The flight is coming

Online check-in system finally allows you to start the check-in procedure. It’s great!

Before you receive your boarding pass you need to proceed through a few steps where you need to provide various details about yourself (and other people if you check-in a group of individuals), selected seats or additional baggage. Most likely it won’t be a single form or page where you could enter all the details in a single shot but rather a series of steps with various texts, input fields and buttons.

So what are the most important things you need to do to use your check-in window wisely? Here is the checklist:

1. Analyse available options

Analyse what options are available during each of the check-in steps but hold on before clicking on the buttons titled ‘Next’, ‘Continue’ or ‘Submit’, especially if during your exploration you don’t provide true and valid data as you might not have a second chance to get back to the start. You don’t want to have any problems at the airport, do you?

2. Save the web page but be careful

Save the web page for offline usage but don’t treat it like a solution for all your problems as some parts of the page may be dynamically loaded and you might not be able to save all the information you need in advance. Also, you won’t have the same user experience as with the online system, and it might be tricky to mimic the most important parts.

3. Use helpful tools

Use Chrome DevTools or Firefox Developer Tools to inspect HTML elements on the page to quickly locate the necessary inputs and buttons which identifiers or other selectors will be needed to find these elements later using the bot you will write.

4. Check the backend

Explore content of the HTML DOM and attached scripts, check for hidden elements, search for commented code or HTML tags, look for global window objects or custom data attributes, pay attention to the name of the elements’ identifiers. The more information you will find, the easier it will be to understand the whole system. By browsing the source codes, you might find other check-in options which are not available for your booking. For example, if some HTML element has an identifier named “passenger_1” but you are checking-in only one person then you can assume how the structure of the page would look if you would check-in many people at once.

5. Be a gold digger

If, at the last step, the system doesn’t provide a link to download the boarding pass but gives you an option to print it, dig a little deeper. Most likely you will find a link to the PDF file which you will be able to download or pass a link to one of your friends.

Fly away

Airline’s online check-in system doesn’t have to be hard to crack. However, it’s good to be prepared before you get access to the system and use the check-in window wise. Many times you might not have a second chance to test if your bot is working as expected, so it’s good to test the smallest possible parts of your code. You should now also know how you can explore the airlines’ websites to gather as many worthful information as it’s possible before you start coding.

The next article will be focused on the programmatic approach to the problem where you will learn what tools can be used and how to use them efficiently to get the booking pass based on the initially provided data or automatically change a seat for your reservation.

Have a good flight!

Konrad Kierus
Software Developer

Software developer focused mainly on mobile applications development, both native and hybrid solutions, but familiar with web technologies as well. He believes that programming languages are just tools to solve problems and he is not afraid of learning new ones. In a free time, he makes sure his son won't hurt himself nor anyone else.