This is a simple Flask application that scrapes the Steam store's special sales page and displays the discounted games. The website uses BeautifulSoup to parse the HTML and requests library to send HTTP requests.
- Clone this repository to your local machine.
- Make sure you have Python installed (version 3.6 or higher).
- Install the required dependencies by running the following command:
pip install flask beautifulsoup4
- Open a terminal and navigate to the project directory.
- Run the Flask application using the following command:
python app.py
- Open a web browser and go to
http://localhost:5000
. - You should see a list of Steam games on sale, including their titles, discounts, prices, and images.
The Flask application consists of a single route that renders the sales.html
template. The template is passed the data retrieved from the get_steam_sales
function.
The get_steam_sales
function performs the following steps:
- Sends an HTTP GET request to the Steam store's special sales page.
- Parses the HTML response using BeautifulSoup.
- Finds all game div elements with the class
responsive_search_name_combined
. - Extracts the game title, discount, price, and image URL from each div element.
- Appends the game information to a list of sales dictionaries.
- Returns the list of sales dictionaries.
Contributions to this project are welcome. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License. Feel free to use and modify it as per the license terms.