# -*- coding: utf-8 -*-
import re, pathlib, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
BASE = pathlib.Path(r"D:\work buddy\2026-11-05-14-15-52")
t = (BASE / "cache" / "gt-progindex.html").read_text(encoding="utf-8", errors="replace")
links = re.findall(r'href="(https://catalog\.gatech\.edu/programs/[a-z0-9\-]+/)"[^>]*>(.*?)</a>', t, re.S)
kws = ["Electrical", "Quantitative", "Supply Chain", "Industrial Engineering", "Operations Research",
       "Computational Science", "Materials Science", "Mathematics", "Urban Analytics", "Statistics",
       "Mechanical Engineering", "Civil Engineering", "Aerospace", "Chemistry", "Physics", "Nuclear"]
seen = set()
for u, name in links:
    name = re.sub(r"<[^>]+>", "", name).strip()
    if u in seen:
        continue
    if any(k.lower() in name.lower() for k in kws):
        seen.add(u)
        print(name, "|", u)
