# -*- coding: utf-8 -*-
import io, sys, os, ssl, urllib.request, urllib.error
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE

slugs=[
 "education",
 "kinesiology-and-physical-education",
 "kinesiology",
 "environmental-sciences",
 "environmental-studies",
 "geology",
 "sociology",
 "psychology",
 "social-work",
 "molecular-genetics-and-microbiology",
 "immunology",
 "pharmacology",
 "nutritional-sciences",
 "exercise-sciences",
 "speech-language-pathology",
 "industrial-relations-and-human-resources",
 "management-analytics",
 "accounting",
 "marketing",
 "epidemiology",
 "biostatistics",
 "occupational-sciences",
 "nursing",
 "forestry",
 "architecture",
 "urban-planning",
 "information-systems",
 "library-and-information-science",
]
for s in slugs:
    url=f"https://www.sgs.utoronto.ca/programs/{s}/"
    try:
        req=urllib.request.Request(url,headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0"})
        r=urllib.request.urlopen(req,timeout=10,context=ctx)
        b=r.read()
        print(f"{s:45s} {r.status} {len(b)}")
    except urllib.error.HTTPError as e:
        print(f"{s:45s} HTTP {e.code}")
    except Exception as e:
        print(f"{s:45s} ERR {type(e).__name__}")
