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

candidates = [
    ('ucsd', 'Engineering Sciences (Computational Engineering and Science)'),
    ('ucsd', 'Convergent Systems Engineering with a Specialization in Architecture-Based Enterprise Systems'),
]
for school, en_frag in candidates:
    pat = r'\{id:"[^"]*",s:"' + school + r'"[^}]*en:"[^"]*' + re.escape(en_frag) + r'[^"]*"'
    matches = re.findall(pat, prog_text)
    print(f'[{school}] {en_frag}: {len(matches)} 条')
    for mm in matches[:3]:
        n_m = re.search(r'n:"([^"]*)"', mm)
        en_m = re.search(r'en:"([^"]*)"', mm)
        deg_m = re.search(r'deg:"([^"]*)"', mm)
        print(f'    n={n_m.group(1) if n_m else "?"} | en={en_m.group(1) if en_m else "?"} | deg={deg_m.group(1) if deg_m else "?"}')
