# -*- coding: utf-8 -*-
import sys, io, re, pathlib, json
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
BASE = pathlib.Path(r"D:\work buddy\2026-11-05-14-15-52")
html = (BASE / "index_main.html").read_text(encoding="utf-8", errors="ignore")
seg = html[html.index('const PROGRAMS=['): html.index('const CATD=[')]
blocks = [b for b in re.split(r'(?=\bid:")', seg) if 'id:"' in b]
ids = ["gatech-robotics-ms","gatech-bme-ms","gatech-bioe-ms","gatech-biology-ms","gatech-medphys-ms",
       "gatech-mgmt-ms","gatech-bcfm-ms","gatech-econ-ms"]
for b in blocks:
    m = re.search(r'\bid:"([^"]+)"', b)
    if m and m.group(1) in ids:
        print(b.strip()[:700].replace("\n", " | "))
        print("-" * 80)
