# -*- coding: utf-8 -*-
import urllib.request, ssl, io, sys, os
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
SCTX = ssl.create_default_context(); SCTX.check_hostname=False; SCTX.verify_mode=ssl.CERT_NONE
UA = {"User-Agent":"Mozilla/5.0"}
cands = [
    ("UT SGS Computer Science", "https://sgs.utoronto.ca/programs/computer-science/"),
    ("UT SGS Electrical Computer", "https://sgs.utoronto.ca/programs/electrical-computer-engineering/"),
    ("UT SGS Mechanical", "https://sgs.utoronto.ca/programs/mechanical-engineering/"),
    ("UT SGS Mathematics", "https://sgs.utoronto.ca/programs/mathematics/"),
    ("UT SGS Statistics", "https://sgs.utoronto.ca/programs/statistics/"),
    ("UT SGS Economics", "https://sgs.utoronto.ca/programs/economics/"),
    ("UT SGS Finance", "https://sgs.utoronto.ca/programs/finance/"),
    ("UT SGS Management", "https://sgs.utoronto.ca/programs/management/"),
    ("UT SGS Accounting", "https://sgs.utoronto.ca/programs/accounting/"),
    ("UT SGS Data Science", "https://sgs.utoronto.ca/programs/data-science/"),
]
for name, url in cands:
    try:
        req = urllib.request.Request(url, headers=UA)
        r = urllib.request.urlopen(req, timeout=12, context=SCTX)
        body = r.read()
        print(f"OK  {r.status} {len(body):>7}B  {name}")
    except Exception as e:
        print(f"ERR {type(e).__name__:>20}  {name}")
