# -*- 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")
for k in ["cornell-acct", "nyu-msacc"]:
    raw = (CACHE / (k + ".html")).read_text(encoding="utf-8", errors="ignore")
    print("=" * 20, k)
    seen = []
    for u, t in re.findall(r'href="([^"]+)"[^>]*>(.{0,60}?)</a>', raw, re.S):
        if re.search(r"curricul|deadline|tuition|faq|test|admission|apply|cost|financial", (u + t), re.I):
            tt = re.sub(r"<[^>]+>", " ", t).strip()
            s = (u, tt)
            if s not in seen:
                seen.append(s)
    for s in seen[:25]:
        print("   ", s)
