# -*- coding: utf-8 -*-
import sys, io, re, pathlib, html as H
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")
i = raw.find("Specializations")
seg = raw[i:]
# specialization names appear before "Course List"
names = re.findall(r"<h5[^>]*>(.*?)</h5>", seg, re.S)
print("H5 count", len(names))
for n in names[:30]:
    print("  ", re.sub(r"<[^>]+>", "", H.unescape(n)).strip())
