# -*- coding: utf-8 -*-
import io, sys, re, os
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
b = r"D:\work buddy\2026-11-05-14-15-52"
for fn in ["quality_report.html"]:
    p = os.path.join(b, fn)
    t = open(p, encoding="utf-8").read()
    loc = [x for x in re.findall(r'(?:src|href)="([^"]+)"', t)
           if not x.startswith("http") and not x.startswith("#") and not x.startswith("mailto")]
    from collections import Counter
    print(fn, "KB:", round(len(t)/1024,1), "本地引用:", Counter(loc).most_common(8))
