# -*- coding: utf-8 -*-
import io, re, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
f = r"D:\work buddy\2026-11-05-14-15-52\cache\r349-e-catalogue-jhu-edu-university-wide-policies-information-adm-4f3c16.html"
t = io.open(f, encoding="utf-8", errors="ignore").read()
t = re.sub(r'<script.*?</script>|<style.*?</style>', ' ', t, flags=re.S | re.I)
t = re.sub(r'<br[^>]*>|</p>|</h\d>|</li>|</tr>', '\n', t, flags=re.I)
t = re.sub(r'<[^>]+>', ' ', t)
t = re.sub(r'&nbsp;', ' ', t).replace("&amp;", "&")
t = re.sub(r'[ \t]+', ' ', t)
t = re.sub(r'\n\s*\n+', '\n', t)
a = int(sys.argv[1]); b = int(sys.argv[2])
print("TOTAL", len(t))
print(t[a:b])
