# -*- coding: utf-8 -*-
import io, sys, os, urllib.request, ssl, re, html
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
def fetch(u):
    req=urllib.request.Request(u,headers={"User-Agent":"Mozilla/5.0"})
    r=urllib.request.urlopen(req,timeout=12,context=ctx); return r.read().decode("utf-8","ignore")
for k,u in {"DS":"https://datascience.rice.edu","CS":"https://www.cs.rice.edu","ECE":"https://ece.rice.edu"}.items():
    h=fetch(u); links=[html.unescape(x) for x in re.findall(r'href="([^"]+)"',h)]
    print("====",k)
    seen=set()
    for x in links:
        if re.search(r"(master|graduate|admission|apply|degree|program|mds|mcs|msc|ms|curriculum|tuition|requirement|deadline)",x,re.I) and x not in seen and not x.startswith("#"):
            seen.add(x); print(" ",x[:90])
