Your First Vibium Script in Python
Write your first Vibium Python script: launch a browser, visit a page, find and click elements, and save a screenshot in about ten lines of code.
Your first Vibium Python script launches a browser, opens a page, finds an element, and clicks it in about ten lines. Import the sync client, call browser.launch(), navigate with vibe.go(), locate elements with vibe.find(), and act with .click() or .type(). Vibium auto-waits for each element, so you never write a sleep.
What do I need before I start?
You need Vibium installed in a Python 3.9+ environment. If you have not done that yet, follow How to Install Vibium first. In short:
pip install vibiumThat command installs the Python client and the Go binary that drives Chrome. Create a file named hello.py in your project folder and you are ready to write code.
How do I write a complete first script?
Paste this into hello.py. It opens a real Chrome window, loads a page, reads a link, clicks it, and saves a screenshot:
from vibium import browser_sync as browser
# Launch Chrome (a window opens by default)
vibe = browser.launch()
# Navigate to a page
vibe.go("https://example.com")
print("Loaded:", "example.com")
# Find an element by CSS selector
link = vibe.find("a")
print("Link text:", link.text())
# Save a full-page screenshot (screenshot() returns PNG bytes)
png = vibe.screenshot()
with open("example.png", "wb") as f:
f.write(png)
print("Saved example.png")
# Click the link
link.click()
print("Clicked the link")
# Close the browser
vibe.quit()Run it:
python3 hello.pyYou will see Chrome open, load example.com, and close. A new example.png file appears in your folder.
What does each line actually do?
Each call maps to one clear browser action, which is what makes Vibium scripts easy to read:
| Code | What it does |
|---|---|
browser.launch() | Starts Chrome and returns a session object (vibe) |
vibe.go(url) | Navigates to a URL and waits for the page to load |
vibe.find(selector) | Locates an element by CSS selector |
el.text() | Returns the element's text content |
el.click() | Clicks the element after auto-waiting |
vibe.screenshot() | Captures the page as PNG bytes |
vibe.quit() | Closes the browser and stops the binary |
How do I type into a form field?
Use find() to locate the input, then call .type() with the text. Vibium auto-waits until the field is actionable before typing:
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://www.google.com")
box = vibe.find("textarea[name='q']")
box.type("vibium browser automation")
vibe.quit()Because Vibium checks actionability for you, there is no need to wait for the field to appear or to retry on a stale element. For a full credential flow, see Automate a login with Vibium.
Why don't I need sleeps or explicit waits?
Vibium auto-waits because actionability is enforced inside its Go binary, not your script. Before any click or type, the binary polls until the element is visible, stable, enabled, and actually able to receive the event, up to a 30-second default timeout. That removes the flaky time.sleep() calls that plague older automation code. You can still tune it per action when you need a shorter or longer window. This server-side waiting is part of how Vibium works under the hood.
How do I capture just one element?
Call screenshot() on the element instead of the page. This is handy for grabbing a single card, chart, or button:
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
heading = vibe.find("h1")
png = heading.screenshot()
with open("heading.png", "wb") as f:
f.write(png)
vibe.quit()The screenshot command reference covers page versus element captures in more detail.
Where do I go next?
You now have a working Python script. From here you can write the same flow in JavaScript, learn when to reach for the async API instead of sync, or hand the browser to an AI agent through the Vibium MCP server in Claude Code.
Frequently asked questions
How do I write a Vibium script in Python?
Import the sync client with from vibium import browser_sync as browser, call browser.launch() to open Chrome, navigate with vibe.go(url), locate elements with vibe.find(selector), then act with click() or type(). Call vibe.quit() at the end. A complete script runs in about ten lines.
Do I need to add waits or sleeps in Vibium Python scripts?
No. Vibium auto-waits for elements to become actionable before interacting. Its Go binary polls until the element is visible, stable, enabled, and able to receive events, up to a 30-second default timeout. You do not write time.sleep() or explicit wait conditions.
How do I take a screenshot with Vibium in Python?
Call vibe.screenshot(), which returns raw PNG bytes. Write those bytes to a file with open('shot.png', 'wb') as f: f.write(png). You can also capture a single element by calling screenshot() on the element returned by vibe.find().
Vibium is created by Jason Huggins. This is an independent tutorial — see the official Vibium site and GitHub repo for canonical docs.
Related guides
Your First Vibium Script in JavaScript
Write your first Vibium script in JavaScript: launch Chrome, open a page, find and click elements, and save a screenshot with the sync API in minutes.
3 min read→Getting StartedHow Vibium Works: BiDi, the Go Binary, and MCP
How Vibium works: a single Go binary speaks WebDriver BiDi to Chrome, enforces auto-waiting, and exposes a built-in MCP server for AI agents. Architecture explained.
4 min read→Getting StartedHow to Install Vibium (Python & Node)
Install Vibium in seconds: pip install vibium for Python or npm install vibium for Node. Learn how the single Go binary auto-downloads Chrome for you.
4 min read→Getting StartedVibium Sync vs Async API
Vibium ships both a sync and an async API. Learn the difference, see Python and JavaScript examples, and choose the right one for your automation script.
4 min read→