# -*- coding: utf-8 -*-
import re, os, io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
BASE=os.path.dirname(os.path.abspath(__file__))
t=open(os.path.join(BASE,'index_main.html'),encoding='utf-8').read()
det=['uw-cfa123b.html','yale-international-development-economics.html','harvard-computational-science-and-engineering.html','uw-c1fa362.html','up-c6b3731.html']
ids=['uw-mmsc-coop','yale-ide-ma','harvard-cse-me','uw-meng-ece-coop','up-bioe-mse']
for d in det:
    print(d,'occurrences:',t.count(d))
for i in ids:
    print(i,'in PROGRAMS:', ('{id:"'+i+'"') in t)
# 样板 h2 数
col=open(os.path.join(BASE,'details','col-cs.html'),encoding='utf-8').read()
print('col-cs h2:',col.count('<h2>'),'外链:',col.count('target="_blank"'))
