import re, os, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
base = os.path.dirname(os.path.abspath(__file__))
html = open(os.path.join(base,'index_main.html'), encoding='utf-8').read()
for tid in ["ubc-meng-ece","emory-econ-ms","emory-ms-ds"]:
    print(tid, "literal:", f'{tid}' in html, "| id literal:", f'{{id:"{tid}"' in html)
    i = html.find(f'{{id:"{tid}"')
    print("  idx:", i)
    if i>=0:
        seg = html[i:i+400]
        print("  seg:", seg[:300])
        print("  has tui:", '"tui:"' in seg)
