cloudflare-browser-rendering_skill

This skill helps you automate headless browser tasks with Cloudflare Browser Rendering for screenshots, PDFs, data extraction, and testing.
  • Python

116

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill einverne/dotfiles --skill cloudflare-browser-rendering

  • SKILL.md19.3 KB

Overview

This skill guides implementation of Cloudflare Browser Rendering to control headless browsers for screenshots, PDFs, scraping, and testing. It explains integration options (REST API, Workers with Puppeteer/Playwright, MCP servers, and AI automation) and delivers practical patterns for session management, caching, and cost optimization. Follow the guide to deploy reliable browser automation workflows on Cloudflare Workers.

How this skill works

Cloudflare Browser Rendering runs headless Chromium instances via REST endpoints or Worker bindings. You can call simple REST endpoints for screenshots, PDFs, or rendered HTML, or embed Puppeteer/Playwright inside Workers for full control, session reuse, and advanced testing features. MCP servers and Stagehand expose AI-driven, natural-language browser automation for agent-based workflows.

When to use it

  • Capture screenshots or generate PDFs of web pages programmatically
  • Scrape dynamic sites that require JavaScript execution or DOM evaluation
  • Automate end-to-end testing, assertions, and visual checks
  • Build AI-powered scrapers or LLM agents that interact with web pages
  • Pool browser sessions or use Durable Objects for persistent authenticated sessions

Best practices

  • Prefer session reuse: disconnect() instead of close() to keep sessions alive
  • Pool tabs via browser contexts and use KV or Durable Objects for session state
  • Cache rendered outputs in KV or R2 to avoid repeated rendering
  • Set explicit timeouts and choose appropriate waitUntil strategies (networkidle, load)
  • Handle rate limits and 429 responses with exponential backoff and Retry-After

Example use cases

  • Screenshot endpoint that checks KV cache, renders page if missing, then stores image
  • PDF certificate generator that sets page content and exports A4 print-ready PDFs
  • AI-driven scraper: render page, send HTML to Workers AI to extract structured JSON
  • Web crawler using Queues: render pages, extract links, enqueue new targets
  • Persistent login sessions via Durable Objects and storageState for multi-request flows

FAQ

Use REST API for quick one-off tasks or external services. Use Workers with Puppeteer/Playwright when you need low-level control, session pooling, or integration with KV, Durable Objects, and Queues.

How do I reduce cost for frequent renders?

Reuse sessions (disconnect), pool tabs with contexts, cache outputs in KV/R2, and use Durable Objects to avoid repeated browser startup overhead.

What are sensible timeouts for navigation and selectors?

Common defaults: page.goto timeout 30–60s, waitForSelector up to 60s, and action timeouts up to 5 minutes depending on workflow complexity.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational