This repository has been archived on 2026-02-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-skills/test_playwright.py
T
OpenClaw Agent 8163c37e83 refactor: 移除bilibili_extractor插件,改用obsidian-kb
- 删除 bilibili_extractor.py 及相关文档和配置
- 删除 bilibili_venv 虚拟环境
- 删除测试脚本和生成的B站笔记
- 以后使用 skills/obsidian-kb 提供的B站提取功能
2026-02-07 14:44:58 +08:00

46 lines
891 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
测试 Playwright 基本功能
"""
import asyncio
from playwright.async_api import async_playwright
async def test_playwright():
"""测试 Playwright"""
print("开始测试 Playwright...")
playwright = await async_playwright().start()
print("Playwright 启动成功")
browser = await playwright.chromium.launch(
headless=True,
args=['--no-sandbox', '--disable-setuid-sandbox']
)
print("浏览器启动成功")
page = await browser.new_page()
print("页面创建成功")
await page.goto('https://www.baidu.com', timeout=30000)
print("页面加载成功")
title = await page.title()
print(f"页面标题: {title}")
await browser.close()
await playwright.stop()
print("测试完成")
if __name__ == '__main__':
asyncio.run(test_playwright())