# -*- coding: utf-8 -*-
import re, os, sys, io, urllib.request, ssl
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
ctx = ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
hdr={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120 Safari/537.36"}
u="https://steinhardt.nyu.edu/degree/ms-applied-statistics-social-science-research/"
req=urllib.request.Request(u, headers=hdr)
with urllib.request.urlopen(req, timeout=15, context=ctx) as r:
    body=r.read(400000).decode("utf-8","ignore")
print("len", len(body))
for m in re.finditer(r'.{120}GRE.{120}', body):
    seg=m.group(0).replace("\n"," ")
    if "GREK" in seg: continue
    print(">>", seg[:280]); print("---")
# 学费
for m in re.finditer(r'.{50}\$\s?[0-9,]{3,}.{30}', body):
    print("$:", m.group(0)[:140])
