# -*- coding: utf-8 -*-
import sys, io, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
BASE = r"D:\work buddy\2026-11-05-14-15-52"
for k in ["wlu-stat-mmath-p", "wlu-mdsai-p", "brown-masters"]:
    h = open(BASE + "\\cache\\r348-" + k + ".html", encoding="utf-8", errors="replace").read()
    print("\n=====", k)
    seen = set()
    for m in re.finditer(r'<a[^>]+href="([^"]+)"[^>]*>(.*?)</a>', h, re.S):
        u = m.group(1); lab = re.sub(r"<[^>]+>", "", m.group(2))
        if re.search(r"tuition|fee|calendar|funding|financial|cost", u + " " + lab, re.I):
            if u in seen: continue
            seen.add(u)
            print(" ", u[:120], "|", lab.strip()[:40])
