# -*- coding: utf-8 -*-
import pathlib, re, sys, io
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="replace")
seg = html[html.index("const PROGRAMS=["):html.index("const CATD=[")]
for pid in ["nyu-ece", "nyu-applied-stat", "nyu-meng-me", "nyu-bme", "nyu-ie", "nyu-cyber", "nyu-ce", "nu-cs", "mcg-mma"]:
    b = seg.find('{id:"%s"' % pid)
    if b < 0:
        print(pid, "NOT FOUND"); continue
    e = seg.find('{id:"', b + 6)
    blk = seg[b:e if e > 0 else b + 1200]
    print("==", pid, "len", len(blk))
    print(blk[:900].replace("\n", " "))
