Extract and process study data from WBH Online Campus HTML exports
Project description
WBH Campus Scraper
Extract and process study program data from WBH Online Campus HTML exports.
Quick Start
# 1. Export HTML from WBH Campus:
# My Studies → Study Programs → [Your Program] (e.g. Computer Science)
# → Save complete webpage as curriculum.html
# 2. Extract data (after installation)
wbh-scraper curriculum.html
# Or during development
python3 main.py curriculum.html
# With options
wbh-scraper curriculum.html --debug # Enable debug mode
wbh-scraper curriculum.html -o my_data.json # Custom output
What Gets Extracted?
A structured JSON file (data.json) containing:
- Study program information (ID, number, name)
- All modules with correct credit points
- All elements (study booklets, exams, seminars)
- All documents (PDF, EPUB, HTML, MP3, ZIP)
- Semester assignments automatically calculated
- Module hierarchy preserved
Features
- OOP architecture with clean data models
- Automatic CP extraction from exams
- Document information for downloads
- Debug mode for development
- Statistics and analysis
- Unit tests for quality assurance
Project Structure
wbh-campus-scraper/
├── scraper/ # Main package
│ ├── models/ # Data models
│ └── scraper.py # Main class
├── tests/ # Unit tests
├── main.py # CLI entry point
└── setup.py # Package setup
How It Works
- Scraping: Extracts JSON data from HTML (
WL.DEBUG.iCurriculumJSON) - Parsing: Processes raw data into structured models
- Building: Creates complete study program hierarchy
- Export: Saves as clean JSON with all relationships
Python API
from scraper import WBHScraper
# Initialize scraper with HTML file
scraper = WBHScraper("curriculum.html")
# Access raw JSON directly (default)
raw_data = scraper.raw_json
# Or get transformed data
study_program = scraper.transform()
print(f"Program: {study_program.study_program.number} {study_program.study_program.name}")
print(f"Total modules: {len(study_program.modules)}")
# Save to file
scraper.save_to_file("output.json")
Installation
# Via PyPI (recommended)
pip install wbh-campus-scraper
# Via Homebrew
brew tap jonaskern-dev/tap
brew install wbh-campus-scraper
# Via pip from GitHub
pip install git+https://github.com/jonaskern-dev/wbh-campus-scraper.git
# For development
git clone https://github.com/jonaskern-dev/wbh-campus-scraper.git
cd wbh-campus-scraper
pip install -e .
# After installation, the command is available:
wbh-scraper --version
# Run tests
python -m unittest discover tests
License
MIT License
Author
Jonas Kern - info@jonaskern.de - https://jonaskern.dev
Version 0.5.1 - Hotfix
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wbh_campus_scraper-0.5.1.tar.gz
(18.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wbh_campus_scraper-0.5.1.tar.gz.
File metadata
- Download URL: wbh_campus_scraper-0.5.1.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9ee94d4bd281e291b01cad6615c78f25093a21629b2850674bf8588acf9702a
|
|
| MD5 |
acd8aa4b856d6ba3d8fe5357f07d9c59
|
|
| BLAKE2b-256 |
72448e16b819668125a0d7b659736b7418d18c2e514e6ec238cf5afa428c03ed
|
File details
Details for the file wbh_campus_scraper-0.5.1-py3-none-any.whl.
File metadata
- Download URL: wbh_campus_scraper-0.5.1-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ea440a10ca2a6dae8058a974b42d0be430fa20c461ce930453412532ae60658
|
|
| MD5 |
d76f7fad769b14877409d520805b7c49
|
|
| BLAKE2b-256 |
320cb04d566fa64f7944a6e6b4e7825c6a58bab9726e48b362d3f55da6f784ad
|