# -*- coding: utf-8 -*-
import io, sys, os, re, html
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")

def load(f):
    b=open(f,"rb").read()
    t=html.unescape(re.sub(r"<script[\s\S]*?</script>|<style[\s\S]*?</style>"," ",b.decode("utf-8","ignore")))
    return re.sub(r"\s+"," ",re.sub(r"<[^>]+>"," ",t))

print("=== DUKE MED PHYS ===")
t=load("_33_duke-c710a43.html")
i=t.lower().find("medical physics")
print(t[i:i+1800])
print()
print("=== HARVARD SEAS SM ===")
t=load("_33_harvard-engineering-and-applied-sciences.html")
i=t.find("Engineering and Applied Sciences")
print(t[i:i+1600])
print()
print("=== YALE ChE ===")
t=load("_33_yale-chemical-environmental-engineering.html")
i=t.find("Chemical & Environmental Engineering")
print(t[i:i+1600])
