# -*- coding: utf-8 -*-
import io,sys,re
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding="utf-8")
t=open("_duke_mems_pratt-req.html",encoding="utf-8").read()
txt=re.sub(r"<script.*?</script>","",t,flags=re.S); txt=re.sub(r"<style.*?</style>","",txt,flags=re.S)
txt=re.sub(r"<[^>]+>"," ",txt); txt=re.sub(r"\s+"," ",txt).strip()
for anchor in ["GRE scores are optional","three letters","3 letters","recommendation letters","video introduction","Video Introduction","short answer","Short Answer","STEM","prerequisite","programming"]:
    i=txt.find(anchor)
    if i>=0:
        print("###",anchor); print(txt[max(0,i-160):i+420]); print("="*70)
