# -*- 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
u="https://grad.uchicago.edu/admissions/apply/english-language-requirements/required-scores/"
req=urllib.request.Request(u,headers={"User-Agent":"Mozilla/5.0"})
with urllib.request.urlopen(req,timeout=25,context=ctx) as r:
    h=r.read().decode("utf-8","replace")
# keep table cells
rows=re.findall(r"<tr[\s\S]*?</tr>",h)
for row in rows:
    txt=re.sub(r"<[^>]+>"," | ",row); txt=re.sub(r"\s+"," ",txt).strip()
    if any(x in txt.lower() for x in ["harris","social science","public policy","physical science","division","booth","life science"]):
        print(txt[:500])
