# -*- coding: utf-8 -*-
import io,sys,ssl,urllib.request,re
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(u):
    req=urllib.request.Request(u,headers={"User-Agent":"Mozilla/5.0"})
    d=urllib.request.urlopen(req,context=ctx,timeout=20).read().decode("utf-8","ignore")
    return d
for home in ["https://masters.cs.uchicago.edu/","https://cs.uchicago.edu/academics/admission/"]:
    d=get(home)
    links=sorted({x for x in re.findall(r'href="([^"]+)"',d) if any(k in x for k in ["admiss","require","faq","english","toefl","ielts","gre","material","application"]) and "mailto" not in x})
    print("====",home)
    for x in links: print("  ",x)
