import re, os, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
base = os.path.dirname(os.path.abspath(__file__))
det={
 "cmu-msin":"details/cmu-msin.html",
 "cmu-msm-ms":"details/cmu-cdd17fa.html",
 "uw-mdsai-coop":"details/uw-c2f6425.html",
 "geo-bioinfo-ms":"details/geo-bioinformatics-ms.html",
}
for i,d in det.items():
    p=os.path.join(base,d.replace("/",os.sep))
    h=open(p,encoding="utf-8",errors="ignore").read()
    t=re.sub(r'<script[\s\S]*?</script>','',h); t=re.sub(r'<style[\s\S]*?</style>','',t)
    t=re.sub(r'<[^>]+>',' ',t); t=re.sub(r'\s+',' ',t)
    print(f"===== {i} =====")
    for kw in ["标化","GRE","GMAT","Executive Assessment"]:
        j=t.find(kw)
        if j>=0:
            print(f"  [{kw}] {t[max(0,j-30):j+160]}")
    print()
