import re
h=open('index_main.html',encoding='utf-8').read()
# Find VD start
i = h.index('const VERIFIED_DETAILS=new Set([')
# Walk forward bracket depth
j = i + len('const VERIFIED_DETAILS=new Set(')
depth = 0
start = j
while j < len(h):
    c = h[j]
    if c == '[':
        depth += 1
    elif c == ']':
        depth -= 1
        if depth == 0:
            end = j
            break
    j += 1
block = h[start:end+1]
urls = re.findall(r'"([^"]+)"', block)
print('VD real count:', len(urls))
print('first 3:', urls[:3])
print('last 8:', urls[-8:])
new5 = ['details/ubc-msc-cs-thesis.html','details/mcgill-msc-ece-thesis.html','details/princeton-mse-mae.html','details/uva-ms-systems-engineering.html','details/mcgill-meng-ece-nonthesis.html']
for u in new5:
    print(f'  contains {u}?', u in urls)
