This repository contains a Python script that scrapes the occupancy level of Unisport Bern fitness rooms. The script runs at short intervals using GitHub Actions and updates a CSV file with the latest occupancy data.
Update the script with your desired intervals or settings, if necessary.
Run the script:
python occupancy_scraper.py
Script Description
The Python script (occupancy_scraper.py) in this repository retrieves the occupancy level of Unisport Bern fitness rooms from the official website. It utilizes the following libraries:
pandas for data manipulation
requests for making HTTP requests
beautifulsoup4 for HTML parsing
The script performs the following actions:
Sends an HTTP request to the Unisport Bern website to retrieve the occupancy data.
Parses the HTML content to extract the occupancy numbers.
Appends the new occupancy data along with the current timestamp to a CSV file (data.csv).
Handles errors as exceptions and prints error messages if any occur.
GitHub Actions
This repository is configured with GitHub Actions to run the script at short intervals automatically. The workflow file (occupancy_scraper.yml) defines the schedule for running the script and updating the data.
File Structure
occupancy_scraper.py: Python script for scraping Unisport Bern occupancy data.
Unisport Bern Occupancy Scraper
This repository contains a Python script that scrapes the occupancy level of Unisport Bern fitness rooms. The script runs at short intervals using GitHub Actions and updates a CSV file with the latest occupancy data.
Usage
To use this script, follow these steps:
Clone this repository to your local machine:
Install the required dependencies using pip:
Update the script with your desired intervals or settings, if necessary.
Run the script:
Script Description
The Python script (
occupancy_scraper.py) in this repository retrieves the occupancy level of Unisport Bern fitness rooms from the official website. It utilizes the following libraries:pandasfor data manipulationrequestsfor making HTTP requestsbeautifulsoup4for HTML parsingThe script performs the following actions:
data.csv).GitHub Actions
This repository is configured with GitHub Actions to run the script at short intervals automatically. The workflow file (
occupancy_scraper.yml) defines the schedule for running the script and updating the data.File Structure
occupancy_scraper.py: Python script for scraping Unisport Bern occupancy data.data.csv: CSV file containing historical occupancy data..github/workflows/occupancy_scraper.yml: GitHub Actions workflow file for scheduling script execution.Notes