Basics demos¶
Five minimal tasks that teach the core building blocks: navigate, wait, extract, screenshot, and inline JavaScript.
title¶
The smallest possible task — open example.com and return the page title.
Concepts: goto, extract, named results, status lines.
screenshot¶
Capture a viewport PNG of any URL. Returns base64 under data.png_b64.
curl -s -X POST localhost:8765/tasks/basics/screenshot -d '{}'
curl -s -X POST localhost:8765/tasks/basics/screenshot -d '{"url":"https://news.ycombinator.com"}'
curl -s -X POST localhost:8765/tasks/basics/screenshot \
-H 'Content-Type: application/json' \
-d '{"url":"https://example.com"}' \
| python3 -c '
import json, sys, base64
b = json.load(sys.stdin)["data"]["png_b64"]
open("/tmp/shot.png", "wb").write(base64.b64decode(b))
print("saved /tmp/shot.png")
'
Concepts: input schema, {{url}} templating, screenshot action.
inline-js¶
Run arbitrary JavaScript inline with templated arguments.
The task uses an inline js step to read document.title and return structured
data without a separate .js file.
Concepts: js, inline scripts, returning values from JS.
See also: JS modules for reusable scripts in scripts/.
save-html¶
Dump the fully rendered HTML to a server-side path.
Concepts: writing files, server-side output, rendered DOM vs source.
wait-then-click¶
Navigate, wait for an element, click it, then extract the result.
Concepts: wait until, click, chaining steps.
What's next?¶
- Crawl demos — extract lists from real websites
- Writing tasks — author from scratch