from playwright.sync_api import sync_playwright
with sync_playwright() as p:
    b=p.chromium.connect_over_cdp("http://localhost:29229")
    for w,name in [(1400,'desktop'),(390,'mobile')]:
        ctx=b.new_context(viewport={'width':w,'height':900},java_script_enabled=False)
        pg=ctx.new_page(); pg.goto("http://localhost:3101/vs/evidence-copilot/")
        el=pg.get_by_text("Scorecard, question by question")
        el.scroll_into_view_if_needed()
        pg.screenshot(path=f"<local path>{name}-full.jpg",full_page=True)
        tbl=pg.locator("table").first
        tbl.screenshot(path=f"<local path>{name}-table.jpg")
        print(name, pg.locator("table th").all_inner_texts())
        ctx.close()
