# -*- 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):
    try:
        req=urllib.request.Request(u,headers={"User-Agent":"Mozilla/5.0"})
        resp=urllib.request.urlopen(req,context=ctx,timeout=20)
        d=resp.read().decode("utf-8","ignore")
        h=re.sub(r"<script.*?</script>"," ",d,flags=re.S|re.I); h=re.sub(r"<style.*?</style>"," ",h,flags=re.S|re.I)
        t=re.sub(r"<[^>]+>"," ",h); t=re.sub(r"&nbsp;|&#x27;|&amp;|&#8217;|&#038;|&#8203;"," ",t); t=re.sub(r"\s+"," ",t)
        return resp.status,len(t),t
    except Exception as e:
        return "ERR",type(e).__name__,str(e)[:120]
for u in ["https://cs.nyu.edu/home/master/prospective_mscs.html",
          "https://gsas.nyu.edu/nyu-as/gsas/admissions/arc/test-scores.html",
          "https://gsas.nyu.edu/admissions/arc/programs/computer-science.html"]:
    st,n,t=get(u); print("="*20,u,"STATUS",st,"LEN",n)
    if isinstance(t,str): print(t[:1500])
