# -*- coding: utf-8 -*-
import io, sys, os, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
t=open("index_main.html",encoding="utf-8").read()
s=t[t.find("const PROGRAMS="):t.find("const CATD=")]
det=["details/uw-c435976.html","details/uw-cb1d654.html","details/uw-cb1705c.html",
     "details/dartmouth-engineering-sciences-ms.html","details/yale-personalized-medicine-applied-engineering.html"]
for d in det:
    print(d,"| PROG:",("IN" if d in s else "no"),"| disk:",("exists" if os.path.exists(d) else "absent"),
          "| size:",(os.path.getsize(d) if os.path.exists(d) else 0))
# 末条锚点
last=re.findall(r'\{id:"([^"]+)",[\s\S]*?url:"([^"]+)"',s)[-1]
print("last anchor:",last)
