import re, os
base = os.path.dirname(os.path.abspath(__file__))
html = open(os.path.join(base, "index_main.html"), encoding="utf-8").read()
target = '"details/uva-msa.html"'
idxs = [m.start() for m in re.finditer(re.escape(target), html)]
print("出现次数:", len(idxs))
for k in idxs:
    print(repr(html[k-30:k+45]))
# 是否 CATD 引用
catd = re.search(r"const CATD\s*=\s*\[(.*?)\];", html, re.S).group(1)
print("CATD 引用:", target in catd)
