# -*- coding: utf-8 -*-
import io, sys, os, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
idx = open("index_main.html", encoding="utf-8").read()
for kw in ["Applied Positive Psychology", "Master of Public Health", "Government Administration", "International Master of Public Administration", "Statistics, Measurement"]:
    print(f"\n=== {kw} ===")
    for m in re.finditer(re.escape(kw), idx):
        i = m.start()
        # only show if in PROGRAMS/CATD context (look for {id: or [")
        ctx = idx[max(0,i-200):i+200]
        # detect if this is a program entry
        if '{id:"' in ctx or '["' in ctx or '"en":"' in ctx:
            print("---", ctx.replace("\n"," ")[:400])
