# -*- coding: utf-8 -*-
import urllib.request, ssl, re, sys, io, os
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
SCTX = ssl.create_default_context()
SCTX.check_hostname = False
SCTX.verify_mode = ssl.CERT_NONE
hdr = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"}

def fetch(url):
    req = urllib.request.Request(url, headers=hdr)
    r = urllib.request.urlopen(req, timeout=15, context=SCTX)
    return r.read().decode("utf-8", errors="ignore")

# 看 Adult Education 页面 Quick Facts 段原始HTML
html = fetch("https://www.sgs.utoronto.ca/programs/adult-education/")
qi = html.find("Quick Facts")
print("Quick Facts at:", qi)
if qi > 0:
    print(html[qi:qi+2000])
