import re, sys, io, urllib.request, ssl
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
ctx = ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
def get(url):
    req = urllib.request.Request(url, headers={"User-Agent":"Mozilla/5.0"})
    with urllib.request.urlopen(req, timeout=12, context=ctx) as resp:
        return resp.read().decode("utf-8","ignore")
def clean(b):
    t=re.sub(r'<script[\s\S]*?</script>','',b); t=re.sub(r'<style[\s\S]*?</style>','',t)
    t=re.sub(r'<[^>]+>',' ',t); return re.sub(r'\s+',' ',t)
t=clean(get("https://www.cmu.edu/tepper/programs/master-science-management/apply-msm"))
for anchor in ["One of these tests","while many Tepper","Waiver Application","waived"]:
    i=t.find(anchor)
    if i>=0:
        print(f"--- {anchor} ---")
        print(t[max(0,i-150):i+330]); print()
