Simplex provides a variety of functions that you can use to interact with the page.

Actions

There are two types of actions Simplex exposes: agentic actions, which call our custom web agents, and non-agentic actions, which are traditional browser automation actions like going to a web page, typing in text, or emulating key presses.

Agentic actions: agentic, click, click_and_upload, click_and_download, hover, exists, get_dropdown_options, and scroll_to_element.

Non-agentic actions: goto, type, press_enter, scroll, wait, and reload.

We used the goto and wait actions in the Sessions example. In the following example, we display the click, type, press_tab, press_enter, and exists actions.

from simplex import Simplex

simplex = Simplex(api_key="your_api_key")
simplex.create_session(workflow_name="login_flow", proxies=False)
simplex.goto("https://www.simplex.sh/login-example.html")
simplex.click("Username field") # tab into the username field
simplex.type("marco@simplex.sh")
simplex.click("Password field") # tab into the password field
simplex.type("SuperSecretPassword123!")
simplex.click("Login button")
simplex.wait(1000)
session_data = simplex.capture_login_session()
print(session_data)
simplex.close_session()

Extractors

Simplex currently provides one extractor — extract_text.

from simplex import Simplex

simplex = Simplex(api_key="your_api_key")
simplex.create_session(proxies=False)
simplex.goto(url="https://data.gov/")
simplex.click("search bar field")
simplex.type("simplex")
simplex.press_enter()
dataset_title = simplex.extract_text("first search result title")
print(dataset_title)
# Output: Terrestrial Vegetation Monitoring Database

This will extract the title of the first search result from data.gov.