Skip to content

An automation-based bot to guide you through the accommodation-booking process on booking.com

Notifications You must be signed in to change notification settings

ps4449/booking-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Booking.com Assistant

An automated bot that provides listings for bookings on the website www.booking.com.
Explore the implementation »

View Demo · Report Bug · Request Feature

Table of Contents
  1. Introduction
  2. Getting Started
  3. About the Bot
  4. Contributing
  5. Further Work
  6. License

Introduction

To understand automation, its usage in testing and effectiveness with time, Booking.com Assistant was created to automate the hotel-booking process to accommodate for people's travel. This project is entirely built with python [ver 3.9].

Getting Started

Prerequisites

System

Software

  • Chrome Webdriver
  • Python 3.9 Interpreter

Packages

  • For the automation: selenium
  • For CLI printing (python): prettytable

Installation

  • Install the requirements file using pip install -r requirements.txt
  • Find the Chrome Webdriver here. (download the version most compatible with your browser version)
  • Please make sure to check the versions of all the packages mentioned, since some packages may not work on recent releases.

About the Bot

Overview

www.booking.com is one of the largest online hotel booking facilitators in the world. On this website, I have learned to execute selenium-based automation along with python as my base language. This program takes in the city as location, along with the duration and the number of adults, and searches deals for the given location.

This program automates on a Chrome browser. Selenium uses a framework called Web Driver, which allows us to execute tests across various browsers. Web Driver makes it possible to write a test script in Linux and run it in Windows, all by setting one variable correctly. There are multiple programming languages which are supported by Web Driver such as Java, Python, Ruby, .Net, PHP to create test scripts.

Execution

For smooth execution of the script, all you need to do is set the PATH variable to direct to the path of the directory which stores your webdriver.

For Webdrivers:

  • For Windows: setx PATH "%PATH%;C:\webdriver-location-here\"
  • For macOs and Linux: export PATH=$PATH:/webdriver-location-here >> ~/.profile

Contributing

Projects are made successful and more efficient due to the contribution of many developers worldwide. The spirit of open source is greatly appreciated, and you are encouraged to make any valid contributions to fix a bug or add an appropriate feature.
  • Rules

    Read CONRIBUTING.md before submitting a pull request.
  • File Structure

    Go through our directory structure to get a better idea about performing and commiting changes.
          |   main.py
          |   README.md
          |   CONTRIBUTING.md
          |   requirements.txt
          |   
          +---.idea
          |   [many config files]
          |           
          +---Bot
          |   |   booking.py
          |   |   booking_filtration.py
          |   |   booking_report.py
          |   |   constants.py
          |   |   __init__.py
          |   |   
          |   \---__pycache__
          |           [many cache files here]
          |           
          \---help
                  pip_show.png
                  refactoring_html.png
                  terminal_output.txt
                  tree.txt
        
    Most of the contributions will be made in the Bot directory or main.py file. The help directory contains some resources that helped me figure out the project.

Further Work

  • To make the CLI execution more detailed
  • To authorize login from CLI
  • To add a sorting feature according to stars and prices
  • To provide top 5 deals for every search based on price, rating
  • Add lxml functionality to clean the html entities such as (amphersant)nbsp

License

THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.

Note: Read the terms and conditions of the Creatives Commons License.

About

An automation-based bot to guide you through the accommodation-booking process on booking.com

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages