import requests, re
H = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36",
     "Accept": "text/html,*/*;q=0.8"}
r = requests.get("https://catalog.upenn.edu/graduate/programs/", headers=H, timeout=25)
print("status", r.status_code, len(r.text))
slugs = re.findall(r'href="(/graduate/programs/[a-z0-9\-]+/)"', r.text)
print("count", len(slugs))
kw = ["quant", "artificial", "computer-science", "graphics", "behavioral", "biotech", "medical-physics", "health-care", "energy", "systems-engineer", "information-technology"]
for s in slugs:
    if any(k in s for k in kw):
        print(s)
