避开访问百度的过程
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-12-04 22:23:11 +08:00
parent e1b5f9cfc9
commit 73aad89f57

View File

@ -5,7 +5,13 @@ def main():
with playwright.sync_api.sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
page.goto("https://www.baidu.com")
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()