A simple API built with Flask that scrapes the current prices of points for various airline loyalty programs from MaxMilhas using Selenium and BeautifulSoup. The API returns the latest prices for each airline program in a JSON format.
- Scrapes the most recent point prices from MaxMilhas.
- Returns a JSON with airline loyalty program names and corresponding prices.
- Built using Flask, Selenium, and BeautifulSoup.
- Headless Chrome browser used for scraping.
- The API sends a request to the MaxMilhas page.
- It uses Selenium to load the page and BeautifulSoup to parse the HTML content.
- Scrapes the airline program names and their point prices.
- Returns a dictionary of the program names and prices.
-
Clone this repository:
git clone https://github.com/your-username/airline-points-scraper.git
-
Navigate to the project directory:
cd airline-points-scraper
-
Install dependencies:
pip install -r requirements.txt
-
Make sure you have Chrome installed on your machine and set up the ChromeDriver for Selenium.
-
Run the Flask app:
python app.py
-
The API will be available at
http://localhost:5000/
. You can make a GET request to this endpoint, and the current point prices will be returned in a JSON-like format.
{
"Program A": "R$ 22,00",
"Program B": "R$ 18,50",
"Program C": "R$ 25,00"
}