How to Get Element Text in Vibium
Read an element's text in Vibium with el.text(). Runnable Python examples for reading headings, asserting content, and looping over results.
To get an element's text in Vibium, find the element and call text(), like vibe.find("h1").text(). It returns the element's text content as a plain Python string that you can print, assert on, or store.
How do I read the text of an element?
Locate the element with find(), then call text(). Vibium returns the element's text content as a string.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
heading = vibe.find("h1")
print(heading.text()) # e.g. "Example Domain"
vibe.quit()Because find() auto-waits, the element is present by the time you read it — you do not need to guard text() with a separate existence check for content that loads slightly after the page.
How do I assert on text in a test?
Read the text with text() and compare it using ordinary Python. Since the return value is a normal string, any assertion style works.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
title = vibe.find("h1").text()
assert title == "Example Domain", f"Unexpected heading: {title}"
# Substring checks work too
assert "Example" in vibe.find("p").text()
vibe.quit()This keeps Vibium out of your way: there is no special matcher to learn, so text() slots straight into pytest, unittest, or whatever framework you already use.
How do I read text from many elements?
Use findAll() to collect every matching element, then call text() on each in a loop.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
for item in vibe.findAll("li"):
print(item.text())
vibe.quit()findAll() returns its matches as a list right away rather than auto-waiting, and you get an empty list when nothing matches. This is the standard way to scrape a list, validate every row in a table, or gather link labels for further checks.
Next steps
Frequently asked questions
How do I get an element's text in Vibium?
Find the element with find(), then call text() on it, like heading = vibe.find('h1'); print(heading.text()). Vibium reads the element's text content and returns it as a string you can print, assert on, or store for later use in your script.
How do I assert on text with Vibium?
Read the text with text() and compare it in plain Python, for example assert vibe.find('h1').text() == 'Welcome'. Because text() returns a normal string, you can use any assertion library or framework you already use, with no Vibium-specific matcher required.
How do I read text from many elements in Vibium?
Use findAll() to get a list of elements, then call text() on each in a loop. For example iterate over vibe.findAll('li') and print item.text() for each, which collects the text content of every matching element on the page. findAll() returns immediately and gives an empty list when nothing matches.
Vibium is created by Jason Huggins. This is an independent tutorial — see the official Vibium site and GitHub repo for canonical docs.
Related guides
How to Click Elements in Vibium
Click buttons and links in Vibium with el.click(). Runnable Python examples plus how auto-waiting and actionability make clicks reliable.
2 min read→Commands & APIHow to Find Elements in Vibium
Find elements in Vibium with find() using CSS or semantic selectors. Runnable Python examples, findAll, and how auto-waiting works.
3 min read→Commands & APIHow to Navigate to a URL in Vibium (go)
Navigate to any URL in Vibium with vibe.go(url). Runnable Python examples for opening pages, chaining navigations, and what go() waits for.
2 min read→Commands & APIHow to Type Text into Inputs in Vibium
Type into text fields in Vibium with el.type(). Runnable Python examples for filling inputs, plus how auto-waiting keeps typing reliable.
2 min read→