Skip to main content

Emunium

Documentation · Quick start · Changelog

Browser automation with real OS mouse and keyboard input. No WebDriver. No CDP-driven page actions.

Emunium is for browser automation where protocol-generated clicks and keystrokes are not what you want. It reads the page through a small browser extension, then moves the real cursor, clicks, types and drags through the operating system. On Windows that means Win32 SendInput / SetCursorPos; on Linux, X11 XTest; on macOS, the native desktop path used by pyautogui.

It works with installed Chrome, Edge, Brave and Chromium, can attach to your own persistent browser profile, and supports Firefox-family browsers such as Camoufox through Browser.connect(). Chrome 137+ is handled without a remote-debugging TCP port for extension loading: Emunium uses a private debugging pipe for that step, while its own extension bridge stays local on 127.0.0.1.

Human input is built in. The default pointer planner uses sigma-lognormal strokes based on the Plamondon model, Fitts' law timing, drift, tremor and occasional corrective movement. You can switch between natural, careful and brisk presets without tuning the math yourself.

Emunium does not claim to bypass Cloudflare, anti-fraud systems or bot detection. Its difference is architectural: browser state is read through an extension, while input is delivered through the OS instead of WebDriver/CDP input commands.

Preview

Why Emunium?

Typical browser automation Emunium
Clicks and typing Browser automation protocol Real OS mouse and keyboard input
Cursor Browser-level pointer actions The real system cursor moves
Input verification Framework-dependent Checks that the page sees the pointer over the target before clicking
Browser profile Often a dedicated automation session Installed browsers, persistent profiles, or attach to your own browser
Human-like motion Usually custom work natural, careful, brisk presets built in
Browser control WebDriver / browser protocol stack Extension bridge for page state + OS-native input
Camoufox Separate integration work Supported through Browser.connect() with a prepared profile

If you need a headless scraper, Playwright or Selenium may be the simpler tool. If you need a visible browser driven through the same mouse and keyboard path as a desktop user, that is the problem Emunium is built around.

Install

pip install emunium

Python 3.10+ is required.

See installation for platform requirements and optional extras.

Quick start

from emunium import Browser, expect

with Browser() as browser:
    browser.goto("https://example.com/")
    expect(browser).to_have_title("Example Domain")

    with browser.expect_navigation("*iana.org*") as navigation:
        browser.get_by_role("link").first.click()
    print(navigation.value.title)

The locator API supports CSS, XPath, roles, labels, placeholders and test ids. Actions wait for the element and then use native input. The quick-start guide also covers application flows, assertions and network waits.

Browsers

By default, Emunium launches the first installed browser it finds in this order:

Chrome -> Edge -> Brave -> Chromium -> Chrome for Testing

Choose one explicitly when needed:

from emunium import Browser

with Browser(browser="chrome") as browser:
    browser.goto("https://example.com/")

Supported launch targets include chrome, edge, brave, chromium, cft, auto, or a Chromium executable path.

See browser setup for discovery, extension installation and browser-specific requirements.

Camoufox and other Firefox-family browsers

Firefox-family browsers use Browser.connect() and a persistent Emunium extension. Pass a prepared Camoufox profile instead of asking Emunium to manufacture or modify its fingerprint:

from emunium import Browser

camoufox_path = r"C:\Browsers\Camoufox\camoufox.exe"
camoufox_profile = r"C:\Browsers\Camoufox\profiles\automation"

with Browser.connect(
    browser=camoufox_path,
    user_data_dir=camoufox_profile,
    timeout=120.0,
) as browser:
    browser.goto("https://example.com/")
    print(browser.title)

The same attach mode works with your own Chrome, Edge, Brave or Chromium profile when the Emunium extension is installed there.

Follow the connection guide to install the persistent extension and prepare a Firefox or Camoufox profile before running this example.

Human input presets

The default is natural.

from emunium import Browser

browser = Browser(motion="natural", typing="natural")
browser = Browser(motion="careful", typing="careful")
browser = Browser(motion="brisk", typing="brisk")
Preset Pointer Typing
natural General-purpose human-like movement 280 characters/minute median
careful Slower, more corrective movement 200 characters/minute median
brisk Faster movement 420 characters/minute median

You normally do not need to tune anything below this level.

See human-like input for preset behavior, custom planners and typing options.

How the motion model works

The default SigmaDriftPlanner combines:

  • sigma-lognormal strokes inspired by Plamondon's model;
  • Fitts' law for movement duration: a + b * log2(D / W + 1);
  • target-size-aware timing;
  • tremor and slow drift;
  • occasional overshoot or undershoot followed by a corrective sub-stroke.

Alternative planners are BezierTremorPlanner, WindMousePlanner and LinearPlanner. Custom planners can implement the MotionPlanner protocol.

The motion planner reference covers timing, parameter ranges and validation rules. See typing rhythm for the keystroke model.

Native input

On Windows, mouse and keyboard events are sent through Win32 APIs. Unicode text is emitted as keystrokes with SendInput, so Cyrillic, CJK, accented characters and emoji do not depend on the active keyboard layout.

On Linux, input goes through X11 XTest and requires X11 or XWayland. On macOS, desktop input uses pyautogui and the required Accessibility permissions.

Before a click, Emunium verifies that the page actually sees the pointer over the target. If it cannot verify the target, it raises an error instead of clicking blindly.

See mouse and keyboard for input actions and coordinates, DPI and zoom for click verification and multi-monitor behavior.

Standalone desktop automation

Emunium can also drive non-browser desktop applications through screenshot template matching and OCR:

pip install "emunium[standalone,ocr]"
from emunium import Emunium

emu = Emunium(ocr=True)
button = emu.find_text_elements("Sign in")
if button:
    emu.click_at(button[0])

The standalone guide covers image matching, OCR, regions and waiting for screen content. For HTML queries without a live browser, see PageParser.

Important limitations

  • Native input requires a visible browser window. Headless mode supports DOM/navigation work, not real mouse or keyboard input.
  • Browser element automation is top-frame only; iframes are not traversed.
  • Linux native input requires X11 or XWayland.
  • The real cursor and keyboard are used, so do not fight the automation by using them at the same time.
  • Camoufox support means Emunium can attach to a prepared Camoufox profile; Emunium does not create or guarantee any particular fingerprint.
  • Emunium makes no promise of being undetectable or of bypassing anti-bot / anti-fraud systems.

See the full limitations, headless mode and parallel execution guides before choosing a deployment setup.

Documentation

The full guides and API reference live at emunium.github.io. Continue with element actions, waits, network responses or typed errors.

For release changes, read the changelog or CHANGELOG.md. Documentation corrections are welcome in the website repository; library bugs and feature requests belong in DedInc/emunium.

License

MIT

Metadata

Release files for emunium 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emunium 3.1.0
File Size Uploaded Provenance Actions
emunium-3.1.0.tar.gz 479.7 kB Without provenance Details for emunium-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for emunium 3.1.0
File Interpreter ABI Platform Actions
emunium-3.1.0-py3-none-any.whl Python 3 none any Details for emunium-3.1.0-py3-none-any.whl

Total release size: 724.4 kB

Release files / emunium-3.1.0.tar.gz

Download URL emunium-3.1.0.tar.gz
Size 479.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b62ee1e86758d75f77029bc5740a37e071737b77a926bbe953edcb847fe7ecc0
BLAKE2b-256 checksum
How to use checksums
832c1fbffa120ac9ed0395c55c12fa8384464001dd9f177a6f1bdb640de0fd27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / emunium-3.1.0-py3-none-any.whl

Download URL emunium-3.1.0-py3-none-any.whl
Size 244.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c64ac695358f1241ec9c14ea3e259eb6ac090ed8f6c245b5d686304f2c5bffc
BLAKE2b-256 checksum
How to use checksums
d4cab457bc58c2bf857ef0d16b4aaba52a64719d3007f2c52b54f5acdca51a0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for emunium 3.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page