Humanized input
humanize layers human-like timing and motion onto ordinary Playwright input. It drives the real input pipeline, no CDP tricks, so the events look exactly like a person using the page.
Turn it on
Pass humanize=True to launch_context and it attaches page.human_click, human_type, human_scroll, human_move and human_dwell. Your normal click/type are left untouched, so existing code keeps working; call the human_* methods where you want human behavior.
from capium import launch_context
# humanize=True attaches page.human_* helpers with human-like timing + motion.
browser, ctx, page = launch_context(seed=200123, humanize=True,
url="https://example.com")
page.human_click("text=Sign in")
page.human_type("#email", "[email protected]")
page.human_scroll(1200)
browser.close()Helpers & presets
You can also attach helpers after launch with humanize(target) (a page or a whole context), or import the functions directly. Each takes a preset: "default" or "careful" (slower, more deliberate).
from capium import launch_context
from capium.human import humanize, click, type_text, scroll
browser, ctx, page = launch_context(seed=200123, url="https://example.com")
# Attach helpers after the fact (preset "default" or "careful")...
humanize(page, preset="careful")
page.human_click("#login")
# ...or call the helpers directly on any Playwright page.
type_text(page, "#user", "alice", preset="careful")
scroll(page, 1200)What it affects
- Timing: natural gaps between actions instead of instant, machine-perfect sequences.
- Motion: pointer movement and click cadence that resemble a real user.
- Input path: uses Playwright input, not synthetic CDP dispatch, so events carry the right trust flags.
Behavioral anti-bot systems score how you move, not just what you send. Combine humanize with a coherent seed and an aligned proxy for the strongest result.