A CLI tool to scrape the Leeds Local Election results page. Data is published as a tabular file on Data Mill North 2 weeks after the result, but in the meantime you can use this tool to extract the data.
The structure of the final file is aimed to roughly align with the format of the file shared on Data Mill North.R
- Python 3.12
- GNU Make
- Create virtual environment
python3.12 -m venv --prompt . .venv
- Install project dependencies
# activate virtual environment . .venv/bin/activate # install dependencies including dev dependencies pip install .[dev]
- Run tests
make test
- Run CLI
This writes the data to a
election_scraper --url https://www.leeds.gov.uk/your-council/elections/leeds-city-council-election-results
results.csv
file in your current directory.
The data is available from within the data/
directory.