# -*- coding: utf-8 -*-
import sys, io, re, pathlib, requests
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
CACHE = pathlib.Path(r"D:\work buddy\2026-11-05-14-15-52\cache")
UA = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Safari/537.36"}
for name, u in [("grad-home", "https://grad.gatech.edu/"),
                ("gt-home", "https://www.gatech.edu/"),
                ("catalog-home", "https://catalog.gatech.edu/")]:
    try:
        r = requests.get(u, headers=UA, timeout=20)
        (CACHE / (name + ".html")).write_text(r.text, encoding="utf-8", errors="ignore")
        links = re.findall(r'href="([^"]+)"', r.text)
        keep = [l for l in links if re.search(r"tuition|fee|cost|deadline|apply|admission", l, re.I)]
        print("==", name, r.status_code, len(r.text))
        seen = []
        for l in keep:
            if l not in seen:
                seen.append(l)
        for l in seen[:25]:
            print("   ", l)
    except Exception as e:
        print(name, "ERR", str(e)[:80])
