headless-web-viewer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHeadless Web Viewer
无头网页查看器
Run
运行
Render + save artifacts
渲染并保存产物
bash
node ./scripts/render_url_playwright.mjs '<URL>' \
--out-html /tmp/page.html \
--out-text /tmp/page.txt \
--out-screenshot /tmp/page.pngbash
node ./scripts/render_url_playwright.mjs '<URL>' \
--out-html /tmp/page.html \
--out-text /tmp/page.txt \
--out-screenshot /tmp/page.pngPrint to stdout (pipe-friendly)
打印到标准输出(支持管道)
bash
node ./scripts/render_url_playwright.mjs '<URL>' --print textbash
node ./scripts/render_url_playwright.mjs '<URL>' --print textDependencies
依赖项
This skill requires Playwright in the environment where it runs.
此技能运行环境需要Playwright。
Option A (recommended for global use, no browser download)
选项A(全局使用推荐,无需下载浏览器)
Install Playwright Core and use system Chrome:
bash
npm i -D playwright-coreRun with .
--channel chrome安装Playwright Core并使用系统Chrome:
bash
npm i -D playwright-core运行时添加参数。
--channel chromeOption B (bundled browsers)
选项B(捆绑浏览器)
bash
npm i -D playwright
npx playwright installDo not auto-install dependencies unless the user asks.
bash
npm i -D playwright
npx playwright install除非用户要求,否则不要自动安装依赖项。
Tips
提示
- If a page hangs on , retry with
networkidle.--wait-until domcontentloaded - If a page blocks headless Chromium, try setting to a realistic UA.
--user-agent
- 如果页面在状态下挂起,尝试使用
networkidle参数重试。--wait-until domcontentloaded - 如果页面拦截无头Chromium,尝试将设置为真实的用户代理字符串。
--user-agent