# -*- coding: utf-8 -*-
import re, sys, io, pathlib, html as H
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")
t = (BASE / "details" / "ucsd-cse-ms.html").read_text(encoding="utf-8", errors="ignore")
print("H2:", [re.sub(r"<[^>]+>", "", x).strip() for x in re.findall(r"<h2[^>]*>(.*?)</h2>", t, re.S)])
print("CARD count:", len(re.findall(r'<div class="card', t)))
print(t[:3000])
