Skip to main content

Auto Playwright Web

多用户 Playwright 脚本管理平台,后端使用 FastAPI,前端使用 Vite + Vue 3 + Element Plus + Monaco Editor。

默认账号

  • 管理员:admin / admin123
  • 测试内存仓储还包含普通用户:demo / demo123

生产 MySQL 首次初始化请先创建业务库,再执行:

mysql -uroot -p123456 auto_playwright_web < app/scripts/init_db.sql

本地开发

uv sync
uv run uvicorn app.main:app --reload
cd frontend
npm install
npm run dev

默认 API 前缀为 /api,前端开发服务器会代理到 http://127.0.0.1:8000。

AI 生成脚本

管理员可以在脚本编辑抽屉里点击“AI 生成”,根据需求自动生成完整脚本草稿,包括脚本编码、名称、参数定义、超时时间和 Python Playwright 源码。后端不使用 OpenAI SDK,而是通过 HTTP 调用 Chat Completions 接口,并以流式响应填充前端编辑器。启用前需要配置:

OPENAI_API_KEY=你的 OpenAI API Key
OPENAI_MODEL=gpt-5.4-mini
OPENAI_BASE_URL=https://api.openai.com/v1

OPENAI_MODEL 和 OPENAI_BASE_URL 都可以按部署环境覆盖。

脚本约定

脚本由管理员维护,所有用户共享。脚本入口必须为:

async def main(params: dict) -> dict:
    print("print 输出会进入 stdout_text")
    return {"ok": True}

建议脚本使用 logging 输出排查日志,平台同时兼容 print。print 会进入 stdout,logging 默认进入 stderr。

Metadata

Release files for auto-playwright-web 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auto-playwright-web 0.1.0
File Size Uploaded Provenance
auto_playwright_web-0.1.0.tar.gz 1.7 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for auto-playwright-web 0.1.0
File Interpreter ABI Platform
auto_playwright_web-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.5 MB

Release files / auto_playwright_web-0.1.0.tar.gz

Download URL auto_playwright_web-0.1.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
49c6feea373da82da98e329af7dda1698c25e8c3b621c51c7aca891900950efe
BLAKE2b-256 checksum
How to use checksums
6f31f1e717d0e36a044ed3c062559ec96396bf8e1b4b1189d656366bfb96f531
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / auto_playwright_web-0.1.0-py3-none-any.whl

Download URL auto_playwright_web-0.1.0-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
06015a91fddbfa37a6898cdad2e32810036aa6a400d56076d6ae1ae5b0ca510c
BLAKE2b-256 checksum
How to use checksums
50511dec64d244564e64efe9a2f789cad5b9777be6fe6f985f260e8c675bdba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for auto-playwright-web 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page