Skip to main content

In this project, Playwright is used to navigate through different airline websites, fill in search forms, click buttons, and extract price information.

Project description

Travel Pricing Scraper

Documentation Status CI PyPI version

Introduction

The objective of this project is to demonstrate my skills in writing scalable, well-documented, and tested code. For this purpose, i've used Playwright as a web scraping tool to fetch airfare prices. While there are more specialized approaches to extract data of this kind, the main emphasis here is to showcase the ability to develop high-quality code using Playwright.

In this project, Playwright is used to navigate through different airline websites, fill in search forms, click buttons, and extract price information. It is important to note that in a real production environment, specific solutions would need to be considered for scraping airfare data. However, this project serves as a basic example of my skills in developing scalable, well-documented, and tested code, using Playwright as a widely documented and tested web scraping tool.

Installation

How to install

To install the project, we recommend to use pipx to install the project in a virtual environment.

pipx install travel-pricing-scraper

This is the recommended way to install the project, but you can also install it using pip:

pip install travel-pricing-scraper

Then install playwright dependencies:

playwright install

How to use

How to use?

You can use scraper via command line. For example:

travels

Options

Origin airport code: CWB
Destination airport code: POA
Date in YYYY-MM-DD format (iso format): 2023-08-01

OR with arguments:

travels --origin CWB --destination POA --date "2023-08-01"

Returns:

Origem Destino Embarque Chegada Preço Companhia
CWB POA 01/08/2023 às 06:00 01/08/2023 às 07:15 R$ 198,00 Gol
CWB POA 01/08/2023 às 16:55 01/08/2023 às 18:05 R$ 198,00 LATAM
CWB POA 01/08/2023 às 09:55 01/08/2023 às 11:10 R$ 369,00 Azul
CWB POA 01/08/2023 às 09:55 01/08/2023 às 11:10 R$ 369,00 Azul
CWB POA 01/08/2023 às 09:55 01/08/2023 às 11:10 R$ 474,00 Azul
CWB POA 01/08/2023 às 09:55 01/08/2023 às 11:10 R$ 474,00 Azul
CWB POA 01/08/2023 às 11:10 01/08/2023 às 15:25 R$ 278,00 Gol
CWB POA 01/08/2023 às 11:50 01/08/2023 às 16:15 R$ 278,00 Gol

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

travel_pricing_scraper-0.1.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

travel_pricing_scraper-0.1.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file travel_pricing_scraper-0.1.2.tar.gz.

File metadata

  • Download URL: travel_pricing_scraper-0.1.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/6.2.6-76060206-generic

File hashes

Hashes for travel_pricing_scraper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c3237346d627c75f16d48086bc2efda6ea82c1dcbe01618211de90064cb78c40
MD5 cc45522894f65e96255539e6572e677c
BLAKE2b-256 6a0427b9e21a24d477e2ae4c89b900d7eef092598c3b9d23ef217f3a88adca81

See more details on using hashes here.

Provenance

File details

Details for the file travel_pricing_scraper-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for travel_pricing_scraper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 383dc87a786bad228b21300c2fb1bd4f1f31e4607e87ba2689457891463c9144
MD5 bc3e8230a390b25820a37217a88a1699
BLAKE2b-256 6ff0e5426a1809e4c3f5cdd68505df8ffa3eb5280b0dfb58ed4b528e8da154ef

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page