Giter Site home page Giter Site logo

swa-scraper's Introduction

SWA-Scraper

Terminal1 Text Terminal2

Inspired by ezekg's swa-dashboard, I created a command line tool that scrapes Southwest Airlines' website and displays the current lowest price of airplane tickets. When the current lowest price gets under some threshold that you specify, a text message will be sent to you.

While ezekg's tool was coded in Node, I wanted to use Python + Selenium for a learning experience.

Use for this program

Airlines often change their prices on random days/times. By using this program, you'll get a text message notification when the prices have fallen by a certain amount. Southwest is known to normally have the cheapest rates, so this program scrapes data from Southwest.

Installation

  1. Clone this repository. git clone https://github.com/wcrasta/SWA-Scraper.git
  2. Make sure you have Python (should work for both 2.X and 3.X) and pip. Install required modules (if needed) by pip install -r requirements.txt
  3. If needed, download PhantomJS and put phantomjs.exe in your Scripts folder (Windows) or /usr/bin folder (Mac/Linux).
  4. Register for a free account on https://www.twilio.com and get a phone number.
  5. Edit app.py with your twilio details.

Usage

Scrapes the Southwest website according to the interval you set. For best results when using this program, I recommend setting the interval between 2-3 hours. A more frequent interval than that might be excessive. When the price goes under a certain amount, you will be notified via text message.

--one-way # Optional. By default, a round trip is assumed.

--from [-f] # The airport to depart from.

--to [-t] # The airport to arrive in.

--departure-date [-dd] # Date to leave.

--return-date [-rd] # Optional. Date to return.

--passengers [-p] # Number of passengers.

--desired-total [-dt] # The total fare for one person should be under this amount (in dollars).

--interval [-i] # Optional. How often to scrape Southwest's website (in minutes). Default value = 3 hours.

Sample commands: Note: Error checking is non-existent, so make sure to enter the commands properly as specified below.

$ python app.py --from HOU --to MDW --departure-date 05/12 --return-date 05/14 --passengers 2 --desired-total 215 --interval 30

$ python app.py --one-way --from HOU --to MDW --departure-date 05/12 --passengers 2 --desired-total 215 --interval 30

Improvements/Possible Added Features

Feel free to contribute to this project! There are many improvements that can be made, both in terms of code quality and in terms of whole new ideas that can be implemented. Thoughts I have for new features (may or may not ever be implemented):

  1. Add flags so that the user can specify what time of day he/she wants to travel.

Instructions for contributing

  1. Fork the repository!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

If you don't know how to implement something, but do have an idea that you would like to see implemented, feel free to shoot me an e-mail and I can try to implement it.

Credits

Author: Warren Crasta ([email protected])

ezekg -- For the idea.

swa-scraper's People

Contributors

wcrasta avatar

Watchers

James Cloos avatar Jordan Facibene avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.