Files
nexus/wiki/entities/Playwright.md
weishen 5789476c23 Batch ingest: Multi-Agent Team / DevOps Maturity / 一语点醒梦中人 / NodeWarden
Sources:
- Agent-usecases-multi-Agent-Team.md
- DevOps-Maturity-Model-From-Traditional-IT-to-Advanced-DevOps.md
- AI-一语点醒梦中人.md
- Home-Office-NodeWarden-把-Bitwarden-搬上-Cloudflare-Workers彻底告别服务器.md

Entities: Trebuh, Cloudflare
Concepts: DevOps成熟度模型, 共享内存模式, 空性智慧, 绝处逢生
2026-04-15 18:05:17 +08:00

39 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Playwright
type: entity
tags: [浏览器自动化, 测试, 爬虫, 开源]
sources: ["https://playwright.dev"]
last_updated: 2026-04-15
---
## 基本信息
- **类型**Microsoft 开源浏览器自动化工具
- **官网**https://playwright.dev
- **支持语言**Python/Node.js/Java/C#
## 核心功能
- **多浏览器支持**Chromium/Firefox/WebKitWebKit 仅 macOS
- **无头模式**headless=True 默认,支持有头调试
- **自动等待**Actionability 检查(元素可见/可点击/attached 等)
- **截图/PDF**:整页截图和 PDF 生成
- **网络拦截**:监听/修改/屏蔽网络请求
- **移动端模拟**viewport 和 userAgent 定制
## 在 Wiki 中的角色
- [[可自动化可扩展AI增强的电商数据采集与处理系统]] 用于渲染 JS 动态页面
- [[Scrapy]] 通过 scrapy-playwright 插件集成,处理反爬或懒加载的电商页面
- Docker 环境mcr.microsoft.com/playwright/python:v1.48.0-jammy
- shm_size 需设置为 2gb 避免浏览器崩溃
## 关键参数
```python
PLAYWRIGHT_LAUNCH_OPTIONS = {
"headless": True,
"args": ["--no-sandbox", "--disable-setuid-sandbox"],
}
PLAYWRIGHT_CONTEXT_ARGS = {
"viewport": {"width": 1280, "height": 720},
}
```