# -*- coding: utf-8 -*-
import io, sys, os, urllib.request, ssl, socket, re, html
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
socket.setdefaulttimeout(12)
def fetch(url):
    req=urllib.request.Request(url,headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"})
    try:
        r=urllib.request.urlopen(req,context=ctx); b=r.read(); return r.status,len(b),b.decode("utf-8","ignore")
    except Exception as e:
        return type(e).__name__,str(e)[:50],""
for u in ["https://carey.jhu.edu/programs/graduate-programs/finance-master-science","https://carey.jhu.edu/programs/graduate-programs/business-analytics-artificial-intelligence-master-science"]:
    st,ln,_=fetch(u); print("Carey",st,ln,u)

for fn in ["geo-bioinfo","vandy-biostat"]:
    t=open("_14_"+fn+".txt",encoding="utf-8").read()
    print("\n==========",fn,"len",len(t))
    print(t[:1800])
