pw
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecommands
命令
Use canonical ops via .
pw execpw exec navigate --input '{"url":"..."}'pw exec page.text --input '{"selector":"..."}'pw exec page.html --input '{"selector":"..."}'pw exec click --input '{"selector":"..."}'pw exec fill --input '{"selector":"...","text":"..."}'pw exec screenshot --input '{"output":"page.png"}'pw exec page.eval --input '{"expression":"..."}'pw exec page.read --input '{}'
For NDJSON loops, use .
pw batch通过使用标准操作。
pw execpw exec navigate --input '{"url":"..."}'pw exec page.text --input '{"selector":"..."}'pw exec page.html --input '{"selector":"..."}'pw exec click --input '{"selector":"..."}'pw exec fill --input '{"selector":"...","text":"..."}'pw exec screenshot --input '{"output":"page.png"}'pw exec page.eval --input '{"expression":"..."}'pw exec page.read --input '{}'
对于NDJSON循环,使用。
pw batchsetup
设置
start daemon for fast warm execution:
bash
scripts/start-daemon.shbrowser session management is via canonical op:
connect- launch:
pw exec connect --input '{"launch":true}' - discover:
pw exec connect --input '{"discover":true}' - clear:
pw exec connect --input '{"clear":true}'
auth in is auto-injected when configured.
./playwright/auth/*.json启动守护进程以实现快速预热执行:
bash
scripts/start-daemon.sh浏览器会话管理通过标准操作实现:
connect- 启动:
pw exec connect --input '{"launch":true}' - 发现:
pw exec connect --input '{"discover":true}' - 清除:
pw exec connect --input '{"clear":true}'
配置后,中的认证信息会自动注入。
./playwright/auth/*.jsoncontext
上下文
runtime/profile state is profile-scoped under .
use for isolation.
.pw-cli-v4--profile <name>运行时/配置文件状态在下按配置文件划分作用域。
使用实现隔离。
.pw-cli-v4--profile <name>wrappers
包装器
scripts/pw.nupw navpw clickpw evalpw execscripts/pw.nupw navpw clickpw evalpw execreferences
参考资料
- cli | auth | connect | daemon
- page | protect | run | test
- cli | auth | connect | daemon
- page | protect | run | test