自动同步: 2026-03-19 02:10
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Test if browser can access network"""
|
||||
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page()
|
||||
|
||||
print("Testing network access...")
|
||||
print("1. Testing example.com...")
|
||||
page.goto("https://example.com", timeout=30000)
|
||||
print(f" Title: {page.title()}")
|
||||
|
||||
print("2. Testing zhihu.com...")
|
||||
page.goto("https://www.zhihu.com", timeout=30000)
|
||||
print(f" Title: {page.title()}")
|
||||
print(f" URL: {page.url}")
|
||||
|
||||
browser.close()
|
||||
print("✅ Browser network test passed")
|
||||
Reference in New Issue
Block a user