# -*- 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"})
    b=urllib.request.urlopen(req,timeout=20,context=ctx).read()
    return b.decode("utf-8","ignore")
def clean(t):
    t=re.sub(r"<script.*?</script>"," ",t,flags=re.S)
    t=re.sub(r"<style.*?</style>"," ",t,flags=re.S)
    t=re.sub(r"<[^>]+>"," ",t); return re.sub(r"\s+"," ",t)
c=clean(get("https://codas.uchicago.edu/frequently-asked-questions/"))
for anchor in ["What prerequisites","What kind of background","What is the difference","Are the MSDS"]:
    i=c.find(anchor)
    print("="*70); print(anchor)
    print(c[i:i+520] if i>=0 else "NOT FOUND")
