Files
nexus/wiki/concepts/Playwright.md
weishen e62797a33a Batch 9: Obsidian插件/AI开源平替/Coze培训/TK面单/Ubuntu科学上网
- Sources: 5个新文档
- Concepts: ProxyChains, SOCKS5代理, Docker Daemon代理
- Index: 更新至 Batch 9
- 累计 sources: 108/182
2026-04-16 06:36:36 +08:00

31 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: concept
tags: [browser-automation, testing, scraping, python]
date: 2025-09-29
---
## Definition
PlaywrightMicrosoft 开源浏览器自动化工具,支持 Chromium、Firefox、WebKit 三大渲染引擎,通过一致的 API 控制真实浏览器加载动态内容。
## Key Properties
- **三大引擎**ChromiumChrome、Firefox、WebKitSafari跨浏览器一致性测试
- **无头模式Headless**`playwright install chromium` 安装无头浏览器,无需图形界面
- **API 风格**同步sync_api+异步async_api两套接口
- **自动等待**Playwright 自动等待元素可操作后才执行操作,减少 flaky tests
- **scrapy-playwright**:将 Playwright 注册为 Scrapy 下载器中间件,处理 JavaScript 动态渲染页面
## Use Cases
- 动态网页爬取JavaScript 渲染内容)
- 端到端测试E2E Testing
- 截图和 PDF 生成
- 自动化填表和交互
## Related Concepts
- [[Scrapy]]:通过 scrapy-playwright 集成作为动态内容爬取解决方案
- [[浏览器自动化]]Playwright 属于浏览器自动化工具类别
- [[Playwright]]Entity工具开发方 Microsoft
## Source
[[Scrapy-Playwright-抓取TikTok-Shop-Data]]