# -*- coding: utf-8 -*-
import io, re
h = io.open("index_main.html", encoding="utf-8", newline="").read()
for pid in ["vandy-msmkt", "ucsd-cse-ms", "wustl-mems-aero"]:
    i = h.index('{id:"%s"' % pid)
    j = h.index('}', h.index('url:', i)) + 1
    blk = h[i:j]
    for k in ["ddl", "lang", "tui", "test", "dur"]:
        m = re.search(r'(?<![A-Za-z])' + k + r':"([^"]*)"', blk)
        print(pid, k, "=>", (m.group(1) if m else "<none>"))
    m = re.search(r'test:\{cls:"([^"]*)"\}', blk)
    print(pid, "cls =>", (m.group(1) if m else "<none>"))
