Skip to content

olivierdevelops/webtasks

Repository files navigation

webtasks

Documentation License: GPL v3

Browser automation as a service. One small binary, a folder of .webtask recipes, and every recipe becomes a typed HTTP endpoint.

📖 Full documentation → olivierdevelops.github.io/webtasks

Built on chromedp (Chrome DevTools Protocol). No chromedriver, no Selenium, no JVM — a single static binary talks to Chrome directly.


Install

curl -fsSL https://olivierdevelops.github.io/webtasks/install.sh | sh

The installer drops the webtasks binary on your PATH (building from source if no prebuilt binary fits your platform). You also need Chrome or Chromium installed — chromedp drives an external browser.

Install guide


30-second quick start

Run a single recipe straight from the terminal — no server, no setup:

git clone --depth 1 https://github.com/olivierdevelops/webtasks ~/webtasks
webtasks run ~/webtasks/capy/demos/01-basics-title.webtask
{ "page": { "title": "Example Domain", "heading": "Example Domain" } }

Or serve a whole bundle over HTTP and call tasks from anything:

WEBTASKS_BUNDLE=~/webtasks/demo webtasks &

curl -s -X POST http://127.0.0.1:8765/tasks/basics/title \
  -H 'Content-Type: application/json' -d '{}' | python3 -m json.tool

Package your own folder of recipes into a deployable bundle:

webtasks bundle ./my-recipes dist/bundle.zip
WEBTASKS_BUNDLE=dist/bundle.zip webtasks

A task is a recipe

Drop this in tasks/crawl/hackernews-top.webtask and it becomes POST /tasks/crawl/hackernews-top:

task "crawl/hackernews-top"
    pool default
    timeout 20000
    transport rest

    goto "https://news.ycombinator.com"
    wait until "tr.athing" timeout 10000

    extract stories from "tr.athing" repeat
        title text ".titleline > a"
        url   attr href on ".titleline > a"
    end
end

The server hot-reloads recipes on every request — edit, re-call, no restart.

Writing tasks


What it does

REST + SSE Call tasks synchronously or stream live progress
Window pools Bound concurrency; keep logged-in sessions alive
Capture PDF, screenshots, MHTML, animated GIF / MP4 recording
Network HAR capture, cookies, console, network-idle waits
JS modules Reusable scripts under scripts/
Secrets Declared, resolved at startup, never in the recipe

The demo/ bundle ships 38 runnable tasks across 11 categories. Real-world bundle: concio/ — a logged-in scrape with secrets, persistent sessions, and blob capture.

Example catalogue


HTTP surface

Endpoint Purpose
GET /health Pool status + task count
GET /tasks List tasks with input/output schemas
POST /tasks/<name> Run a task → JSON response
POST /tasks/<name> + Accept: text/event-stream Stream progress via SSE
GET <mount>/<path> Static file mounts

HTTP API


Documentation

Doc Link
Install install
How it works how-it-works
Writing tasks writing-tasks
Examples (38) demos
Recipes cookbook
Actions reference actions
CLI & commands cli
Deployment deploy

Build the docs locally:

pip install -r requirements-docs.txt
mkdocs serve   # → http://127.0.0.1:8000

License

GNU General Public License v3.0 — copyleft. Derivative works must be GPL-compatible when distributed. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors