import playwright.sync_api


def main():
    with playwright.sync_api.sync_playwright() as p:
        browser = p.chromium.launch()
        page = browser.new_page()
        content = page.content()
        if "<html" in content or len(content) < 100:
            print("✅ Playwright + Chromium 环境正常 (在 about:blank 页面上测试成功)")
        else:
            print("⚠️ Playwright + Chromium 环境启动，但页面内容检查结果异常。")
            print(content)
            raise Exception()
        print("Playwright + Chromium 环境正常")
        browser.close()


if __name__ == "__main__":
    main()

