# -*- coding: utf-8 -*-
import urllib.request, ssl, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
SCTX = ssl.create_default_context()
SCTX.check_hostname = False
SCTX.verify_mode = ssl.CERT_NONE
UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36"
urls = [
  "https://grad.ucsd.edu/degrees/index.html",
  "https://grad.ucsd.edu/programs/",
  "https://jacobsschool.ucsd.edu/education/graduate",
  "https://compass.ucsd.edu/Programs",
  "https://grad.ucsd.edu/academics/degree-programs.html",
  "https://gps.ucsd.edu/",
]
for u in urls:
    try:
        req = urllib.request.Request(u, headers={"User-Agent":UA, "Accept-Language":"en"})
        r = urllib.request.urlopen(req, timeout=12, context=SCTX)
        body = r.read()
        print(r.status, len(body), u)
    except Exception as e:
        print("ERR", type(e).__name__, str(e)[:80], u)
