# -*- coding: utf-8 -*-
import re, io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
h = open('index_main.html', encoding='utf-8').read()
p0 = h.index("const PROGRAMS=["); p1 = h.index("const CATD=[")
seg = h[p0:p1]
for pid in ["nyu-econ","usc-stat"]:
    m = re.search(r'(\{id:"'+pid+r'"[\s\S]*?)(?=\{id:"|,?\n\];)', seg)
    if m:
        print("====", pid, "====")
        print(m.group(1)[:900])
        print()
