# -*- 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=[
 "computer-science","applied-computing","data-analytics","business-analytics",
 "management-analytics","marketing","finance","accounting",
 "urban-planning","urban-development","landscape-architecture",
 "public-health","epidemiology","biostatistics","health-management",
 "kinesiology","exercise-sciences","nutritional-sciences","nutrition",
 "psychology","sociology","anthropology","economics",
 "educational-leadership","higher-education","education",
 "forestry","environmental-sciences","geography",
 "library-and-information-science","information-systems",
 "music","film-studies","art-history","philosophy",
 "molecular-genetics-and-microbiology","cell-biology","genetics",
 "pharmacology","toxicology","pathology",
 "industrial-engineering","mechanical-engineering","materials-science",
 "aeronautics","engineering",
 "nursing","social-work","speech-language-pathology",
]
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=12,context=ctx)
        b=r.read()
        print(s, r.status, len(b))
    except urllib.error.HTTPError as e:
        print(s,"HTTP",e.code)
    except Exception as e:
        print(s,"ERR",type(e).__name__,str(e)[:60])
