Skip to main content

Overview

Tzafon supports two types of computer instances for different use cases.

Browser

Chromium browser control

Desktop

Linux desktop environment control

Browser Instances

Control Chromium browsers for web interactions, testing, and scraping.

Creating a Browser Instance

from tzafon import Computer

client = Computer()
with client.create(kind="browser") as computer:
    computer.navigate("https://example.com")
    computer.click(100, 200)

Browser Capabilities

Browser instances provide full web control:
  • Navigation - Visit any URL
  • DOM Interaction - Click, type, scroll on web pages
  • Form Filling - Submit forms programmatically
  • Screenshots - Capture webpage state
  • JavaScript Execution - Interact with dynamic content

Use Cases

Extract data from websites by navigating, interacting, and capturing screenshots
Automated testing of web applications with real browser interactions
Fill out forms, submit data, handle multi-step workflows
Periodically check website state and capture evidence

Desktop Instances

Control Linux desktop environments for application testing and workflows.

Creating a Desktop Instance

from tzafon import Computer

client = Computer()
with client.create(kind="desktop") as computer:
    computer.click(500, 300)
    computer.type("Hello Desktop")
    computer.hotkey("ctrl", "s")

Desktop Capabilities

Desktop instances provide full desktop control:
  • Application Control - Launch and interact with desktop apps
  • Window Management - Switch between applications
  • File Operations - Open, save, manage files through GUI
  • Keyboard Shortcuts - Use system-wide hotkeys
  • Screenshots - Capture desktop state

Use Cases

Automated testing of desktop applications
Control repetitive desktop tasks and processes
Connect desktop applications that lack APIs
Capture screenshots and recordings of desktop workflows

Comparison

FeatureBrowserDesktop
EnvironmentChromium browserLinux desktop
navigate()✅ Yes❌ No
click()✅ Yes✅ Yes
type()✅ Yes✅ Yes
screenshot()✅ Yes✅ Yes
hotkey()✅ Yes✅ Yes
scroll()✅ Yes✅ Yes
Use CaseWeb controlDesktop app control
The navigate() method is only available for browser instances. All other actions work on both types.

Lifecycle Management

Manual Management

Explicitly terminate when done:
computer = client.create(kind="browser")
# ... use computer
computer.terminate()
Use context managers for automatic cleanup:
with client.create(kind="browser") as computer:
    # ... use computer
    pass  # Auto-terminates here
Always terminate instances to avoid resource leaks and unnecessary charges.

Multiple Instances

You can create and manage multiple instances simultaneously:
from tzafon import Computer

client = Computer()

# Create both browser and desktop
browser = client.create(kind="browser")
desktop = client.create(kind="desktop")

browser.navigate("https://example.com")
desktop.click(100, 200)

browser.terminate()
desktop.terminate()

Choosing the Right Type

1

Web Control?

Use browser instances for websites and web applications
2

Desktop Apps?

Use desktop instances for Linux desktop applications
3

Both?

Create multiple instances as needed

Next Steps