# -*- coding: utf-8 -*-
import sys, io, re, pathlib
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
CACHE = pathlib.Path(r"D:\work buddy\2026-11-05-14-15-52\cache")
raw = (CACHE / "gatech-cs.html").read_text(encoding="utf-8", errors="ignore")
print(re.findall(r'id="([a-z]+textcontainer)"', raw))
print(re.findall(r'<h4[^>]*>(.*?)</h4>', raw, re.S)[:20])
print(re.findall(r'class="sc_courselist"', raw).__len__(), "course tables")
# locate overview text
i = raw.find('id="overviewtextcontainer"')
print(raw[i:i+1500] if i > 0 else "no overview container")
