import re, html, io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
t = open('bing1.html', encoding='utf-8', errors='ignore').read()
res = re.findall(r'<h2><a href="([^"]+)"[^>]*>(.*?)</a></h2>', t)
for u, title in res[:10]:
    print('-', html.unescape(re.sub(r'<[^>]+>', '', title))[:120], '=>', u[:120])
if not res:
    print('(no <h2> results)', len(t))
