# -*- coding: utf-8 -*-
import io, sys, os, re, html
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")

h = open("_45_gatech-stat.html",encoding="utf-8",errors="ignore").read()
# strip tags
t = re.sub(r"<script[\s\S]*?</script>","",h)
t = re.sub(r"<style[\s\S]*?</style>","",t)
t = re.sub(r"<[^>]+>"," ",t)
t = html.unescape(t)
t = re.sub(r"\s+"," ",t).strip()
# find key section
for kw in ["Master of Science in Statistics","Degree Requirements","Admission","Curriculum","Hours","Admissions","Tuition","Deadline","TOEFL","IELTS","GRE","STEM","credit","Credit","hours","Hours","Thesis","Non-Thesis","Option"]:
    i = t.find(kw)
    if i>=0:
        print(f"--- {kw} @{i} ---")
        print(t[max(0,i-50):i+500])
        print()
