This is a Python script that scrapes service status information from Digitaliser.dk. It extracts the names and operational status of the listed services and saves the data in JSON format.
- Scrapes service status from Digitaliser.dk
- Extracts service name and operational status
- Saves data in a structured JSON format
- Appends new data to a local txt file
- Implements some error handling
- Unit and integration test
https://github.com/DimitraSis/digitaliser_scraper.git
# Windows (PowerShell)
python -m venv venv
venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtRun the script to fetch service status data and save it to a txt file:
python scraper.pyBy default, the scraped data is saved in database.txt.
📂 digitaliser_scraper/
│── 📄 scraper.py # Scrapes data from Digitaliser.dk
│── 📄 database.py # Handles saving data to a database
│── 📄 config.py # Stores configuration (e.g., base URL)
│── 📄 requirements.txt # List of dependencies
│── 📄 README.md # Project documentation
│── 📄 database.txt # A file (mocup) database
│── 📄 tests/
│ │── test_scraper.py # Unit test
│ │── test_scraper_integration.py # Integration test
The base URL is stored in config.py:
class Config:
BASE_URL = "https://digitaliser.dk/driftsstatus"If the URL changes, update it in this file. The same for the database.
To run all test files (unit + integration), use:
python -m unittest discover tests