# -*- coding: utf-8 -*-
import re, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
BASE = r"D:\work buddy\2026-11-05-14-15-52"
h = open(BASE + r"\cache\r346-upenn-adm.html", encoding="utf-8", errors="ignore").read()
t = re.sub(r"<script.*?</script>|<style.*?</style>", " ", h, flags=re.S)
t = re.sub(r"<[^>]+>", " ", t); t = re.sub(r"\s+", " ", t)
for kw in ["Deadline", "deadline", "TOEFL", "IELTS", "GRE", "English"]:
    for m in re.finditer(kw, t):
        s = max(0, m.start() - 260)
        print(kw, ">>", t[s:m.start() + 420].strip()[:640], "\n")
        break
print("LEN", len(t))
