# -*- coding: utf-8 -*-
import io, sys, os, ssl, urllib.request, socket
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)
UA={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120 Safari/537.36"}
cands=[
 ("cornell-c239b95-ms.html","https://chemistry.cornell.edu/graduate-program/ms-program"),
 ("dartmouth-mcb-ms.html","https://graduate.dartmouth.edu/mcb/centers-and-programs/mcb-departments-and-center/molecular-and-systems-biology"),
 ("dartmouth-qbs-phd.html","https://geiselmed.dartmouth.edu/qbs/program/the-curriculum/"),
]
for base,url in cands:
    try:
        req=urllib.request.Request(url,headers=UA)
        r=urllib.request.urlopen(req,context=ctx,timeout=12)
        b=r.read()
        open("_35_"+base,"wb").write(b)
        print(base, r.status, len(b), r.headers.get("Content-Type",""), "|", url)
    except Exception as e:
        print(base, "ERR", type(e).__name__, str(e)[:100], "|", url)
