import re, os
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")

html = open('index_main.html', encoding='utf-8').read()
m = re.search(r'const PROGRAMS=\[([\s\S]*?)\];', html)
body = m.group(1)

# 查找 Michigan Ross 相关项目
for kw in ['ross', 'michigan', 'macc', 'mban', 'mscm', 'master of accounting', 'master of business analytics', 'master of supply chain']:
    matches = re.findall(r'\{id:"[^"]*"[^}]*' + re.escape(kw) + r'[^}]*\}', body, re.IGNORECASE)
    if matches:
        print(f"--- {kw} ---")
        for x in matches[:5]:
            print(x[:200])
        print()

# 检查上轮5个新id的重复情况
print("=== 上轮5个新id出现次数 ===")
for pid in ['cornell-mps-acct', 'unc-mac', 'uva-ms-commerce', 'nyu-msacc', 'jhu-msf']:
    cnt = body.count(f'id:"{pid}"')
    print(f"{pid}: {cnt} times")
