# Browser Run Control and interact with headless browser instances programmatically > Links below point directly to Markdown versions of each page. Any page can also be retrieved as Markdown by sending an `Accept: text/markdown` header to the page's URL without the `index.md` suffix (for example, `curl -H "Accept: text/markdown" https://cloudflaredoc.ubitools.com/browser-run/`). > > For other Cloudflare products, see the [Cloudflare documentation directory](https://cloudflaredoc.ubitools.com/llms.txt). ## Overview - [Browser Run 概览](https://cloudflaredoc.ubitools.com/browser-run/index.md): 使用 Cloudflare 的 Workers Browser Run API 控制无头浏览器。自动化任务、截取屏幕截图、将页面转换为 PDF,以及测试 Web 应用。 ## 快速入门 - [快速入门](https://cloudflaredoc.ubitools.com/browser-run/get-started/index.md): 选择集成方式,使用 Quick Actions、Puppeteer 或 Playwright 设置你的第一个 Browser Run 项目。 ## 示例 - [示例](https://cloudflaredoc.ubitools.com/browser-run/examples/index.md): 探索 Browser Run 的 Quick Actions、Puppeteer、Playwright 和 CDP 集成代码示例。 ## Quick Actions 概览 - [Quick Actions 概览](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/index.md): 使用 Browser Run Quick Actions HTTP 端点截取屏幕截图、提取 HTML、生成 PDF 并执行其他常见浏览器任务。 - [/accessibilityTree - 捕获无障碍树](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/accessibility-tree-endpoint/index.md): 使用 Browser Run /accessibilityTree 端点在 JavaScript 执行后从网页捕获无障碍树。 - [参考](https://cloudflaredoc.ubitools.com/api/resources/browser_rendering/index.md): 查看完整的 Browser Run Quick Actions API 参考,了解所有可用端点和参数。 - [/content - 获取 HTML](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/content-endpoint/index.md): 使用 Browser Run /content 端点在 JavaScript 执行后捕获网页的完整渲染 HTML。 - [/crawl - 爬取 Web 内容](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/crawl-endpoint/index.md): 使用 Browser Run /crawl 端点爬取并跟踪网站链接,可配置深度和输出格式。 - [/json - 使用 AI 捕获结构化数据](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/json-endpoint/index.md): 使用 Browser Run /json 端点通过 AI 从网页提取结构化 JSON 数据。 - [/links - 从网页检索链接](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/links-endpoint/index.md): 使用 Browser Run /links 端点从网页提取所有链接,包括隐藏的链接。 - [/markdown - 从网页提取 Markdown](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/markdown-endpoint/index.md): 使用 Browser Run /markdown 端点将网页内容转换为 Markdown 格式。 - [/pdf - 渲染 PDF](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/pdf-endpoint/index.md): 使用 Browser Run /pdf 端点从网页或自定义 HTML 生成 PDF。 - [/scrape - 抓取 HTML 元素](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/scrape-endpoint/index.md): 使用 Browser Run /scrape 端点从特定网页元素提取结构化数据。 - [/screenshot - 捕获屏幕截图](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/screenshot-endpoint/index.md): 使用 Browser Run /screenshot 端点捕获完整渲染网页的屏幕截图。 - [/snapshot - 捕获多种页面格式](https://cloudflaredoc.ubitools.com/browser-run/quick-actions/snapshot/index.md): 在单个 Browser Run /snapshot 请求中从网页捕获 HTML、屏幕截图、Markdown 和无障碍树。 ## Chrome DevTools Protocol (CDP) 概览 - [Chrome DevTools Protocol (CDP) 概览](https://cloudflaredoc.ubitools.com/browser-run/cdp/index.md): 创建持久浏览器会话、管理标签页,并通过 /devtools 端点使用 Chrome DevTools Protocol (CDP) 命令与浏览器交互。 - [与 MCP 客户端配合使用(CDP)](https://cloudflaredoc.ubitools.com/browser-run/cdp/mcp-clients/index.md): 使用 chrome-devtools-mcp 包通过 Model Context Protocol (MCP) 配置 AI 编码智能体以控制 Browser Run 会话。 - [与 Playwright 配合使用(CDP)](https://cloudflaredoc.ubitools.com/browser-run/cdp/playwright/index.md): 从任何 Node.js 环境将 Playwright 连接到 Browser Run 会话,使用 Chrome DevTools Protocol 自动化浏览器任务。 - [与 Puppeteer 配合使用(CDP)](https://cloudflaredoc.ubitools.com/browser-run/cdp/puppeteer/index.md): 从任何 Node.js 环境将 Puppeteer 连接到 Browser Run 会话,使用 Chrome DevTools Protocol 自动化浏览器任务。 - [会话管理(HTTP)](https://cloudflaredoc.ubitools.com/browser-run/cdp/session-management/index.md): 使用 HTTP 端点管理浏览器会话和标签页,包括创建会话、列出 target 和打开 Chrome DevTools UI。 ## Playwright - [Playwright](https://cloudflaredoc.ubitools.com/browser-run/playwright/index.md): 了解如何在 Cloudflare Workers 中使用 Playwright 进行浏览器自动化。访问 Playwright API、管理会话并优化 Browser Run。 - [Playwright MCP 概览](https://cloudflaredoc.ubitools.com/browser-run/playwright/playwright-mcp/index.md): 部署使用 Browser Run 的 Playwright MCP 服务器,为你的智能体提供浏览器自动化能力。 ## Puppeteer - [Puppeteer](https://cloudflaredoc.ubitools.com/browser-run/puppeteer/index.md): 了解如何在 Cloudflare Workers 中使用 Puppeteer 进行浏览器自动化。访问 Puppeteer API、管理会话并优化 Browser Run。 ## Stagehand - [Stagehand](https://cloudflaredoc.ubitools.com/browser-run/stagehand/index.md): 部署使用 Browser Run 的 Stagehand 服务器,为你的智能体提供浏览器自动化能力。 ## 常见问题 - [常见问题](https://cloudflaredoc.ubitools.com/browser-run/faq/index.md): 查找有关 Browser Run 的常见问题解答,包括错误、故障排除和会话管理。 ## 限制 - [限制](https://cloudflaredoc.ubitools.com/browser-run/limits/index.md): 了解与 Browser Run 相关的限制。 ## 定价 - [定价](https://cloudflaredoc.ubitools.com/browser-run/pricing/index.md): 了解 Browser Run 的 Quick Actions 和浏览器会话定价,包括浏览器小时数和并发浏览器费用。 ## 更新日志 - [更新日志](https://cloudflaredoc.ubitools.com/browser-run/changelog/index.md): 查看 Browser Run 的最新变更。 ## features - [自定义字体](https://cloudflaredoc.ubitools.com/browser-run/features/custom-fonts/index.md): 了解如何为 Browser Run 添加自定义字体,用于屏幕截图和 PDF。 - [人工介入(Human in the Loop)](https://cloudflaredoc.ubitools.com/browser-run/features/human-in-the-loop/index.md): 暂时将浏览器控制权交给人工操作员,用于身份验证、敏感操作或难以完全自动化的任务。 - [实时视图](https://cloudflaredoc.ubitools.com/browser-run/features/live-view/index.md): 使用托管 DevTools UI 或原生 Chrome DevTools 实时查看和交互远程 Browser Run 会话。 - [复用会话](https://cloudflaredoc.ubitools.com/browser-run/features/reuse-sessions/index.md): 通过重新连接到现有浏览器会话而非启动新实例来提升 Browser Run 性能。 - [会话录制](https://cloudflaredoc.ubitools.com/browser-run/features/session-recording/index.md): 录制并回放 Browser Run 会话,以可视化调试浏览器自动化脚本。 - [WebMCP](https://cloudflaredoc.ubitools.com/browser-run/features/webmcp/index.md): 使用 WebMCP 让 AI 智能体发现并执行网站暴露的结构化工具,用直接函数调用替代脆弱的截图-分析-点击循环。 ## how-to - [使用 Durable Objects 部署 Browser Run Worker](https://cloudflaredoc.ubitools.com/browser-run/how-to/browser-run-with-do/index.md): 使用 Browser Run API 和 Durable Objects 从网页截取屏幕截图并存储到 R2。 - [部署 Browser Run Worker](https://cloudflaredoc.ubitools.com/browser-run/how-to/deploy-worker/index.md): 创建并部署使用 Browser Run 从网页截取屏幕截图的 Cloudflare Worker。 - [为 Astro 站点生成 OG 图像](https://cloudflaredoc.ubitools.com/browser-run/how-to/og-images-astro/index.md): 使用 Browser Run 自动为 Astro 站点页面生成 Open Graph 社交预览图像。 - [使用 HTML 和 CSS 生成 PDF](https://cloudflaredoc.ubitools.com/browser-run/how-to/pdf-generation/index.md): 使用 Browser Run 配合 Puppeteer 或 Quick Actions,从网页或自定义 HTML 和 CSS 生成 PDF 文档。 - [为爬虫预渲染页面](https://cloudflaredoc.ubitools.com/browser-run/how-to/pre-render-pages/index.md): 使用 Browser Run 渲染 JavaScript 密集型页面,并从 Worker 返回适合爬虫的 HTML。 - [使用 Queues 和 Browser Run 构建 Web 爬虫](https://cloudflaredoc.ubitools.com/queues/tutorials/web-crawler-with-browser-run/index.md): 构建可扩展的 Web 爬虫,使用 Cloudflare Queues 和 Browser Run 异步处理 URL。 ## reference - [自动请求头](https://cloudflaredoc.ubitools.com/browser-run/reference/automatic-request-headers/index.md): 查看 Cloudflare 自动附加到每个 Browser Run 请求的请求头,包括 User-Agent 和 bot 检测标识符。 - [浏览器关闭原因](https://cloudflaredoc.ubitools.com/browser-run/reference/browser-close-reasons/index.md): 识别 Browser Run 会话关闭的原因,并在仪表板中查看常见关闭原因代码。 - [robots.txt 和 sitemap](https://cloudflaredoc.ubitools.com/browser-run/reference/robots-txt/index.md): 配置 robots.txt 规则和 sitemap,以控制 Browser Run 如何访问你的网站。 - [支持的字体](https://cloudflaredoc.ubitools.com/browser-run/reference/supported-fonts/index.md): 查看 Browser Run Chromium 环境中预装的字体列表,用于屏幕截图和 PDF。 - [Quick Actions 超时](https://cloudflaredoc.ubitools.com/browser-run/reference/timeouts/index.md): 配置 Browser Run Quick Actions 的页面加载、选择器等待和操作执行超时设置。 - [Wrangler](https://cloudflaredoc.ubitools.com/browser-run/reference/wrangler/index.md): 使用命令行工具 Wrangler 部署使用 Cloudflare Workers Browser Run API 的项目。 - [Wrangler 命令](https://cloudflaredoc.ubitools.com/browser-run/reference/wrangler-commands/index.md): 使用 Wrangler 从命令行管理 Browser Run 会话。