# -*- 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

cands = [
  ("gatech-ms-or", "https://catalog.gatech.edu/programs/operations-research-ms/"),
  ("gatech-ms-hs", "https://catalog.gatech.edu/programs/health-systems-ms/"),
  ("gatech-ms-qcf", "https://catalog.gatech.edu/programs/quantitative-computational-finance-ms/"),
  ("gatech-ms-ie", "https://catalog.gatech.edu/programs/industrial-engineering-ms/"),
  ("gatech-ms-sce", "https://catalog.gatech.edu/programs/supply-chain-engineering-ms/"),
]
for name, url in cands:
    try:
        req = urllib.request.Request(url, headers={"User-Agent":"Mozilla/5.0"})
        r = urllib.request.urlopen(req, timeout=20, context=ctx)
        b = r.read()
        open(f"_46_{name}.html","wb").write(b)
        print(f"{name} OK {r.status} {len(b)}")
    except urllib.error.HTTPError as e:
        print(f"{name} HTTP {e.code}")
    except Exception as e:
        print(f"{name} FAIL {type(e).__name__} {e}")
