# -*- coding: utf-8 -*-
import io,sys,re,os
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding="utf-8")
f="details/duke-c5d718f.html"
t=open(f,encoding="utf-8").read()
h1=re.findall(r"<h1>(.*?)</h1>",t)
h2=re.findall(r"<h2>(.*?)</h2>",t)
print("h1",len(h1),h1)
print("h2",len(h2))
for x in h2: print("  -",x)
kws=["2027-01-31","2027-03-15","2026-11-03","Optional","TOEFL","IELTS","Duolingo","三封推荐信",
     "Statement of Purpose","Résumé","Writing Sample","US $105","18 个月","Research Project","60%","Intel","Chevron",
     "Standard Track","Critical Minerals","SMiF","4+1","AI + Materials","PhD","Durham","八","0 死链"]
miss=[k for k in kws if k not in t]
print("缺失关键词:",miss)
print("字节",len(t.encode("utf-8")))
print("结果:", "OK" if h1 and len(h2)>=6 and not miss else "CHECK")
