Actions

Actions are the primary way to interact with the page. The current available actions are click/click_and_upload/click_and_download, hover, exists, scroll_to_element, select_dropdown_option, goto, type, press_enter, 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.

odoo_login.py
from simplex import Simplex

simplex = Simplex(api_key="your_api_key")

simplex.create_session()
simplex.goto("https://odoo.com/")
simplex.click("Sign in")
simplex.click("Email field")
simplex.type("example@example.com")
simplex.press_tab()
simplex.type("example_password")
exists, reason = simplex.exists("Verify if you are human") ## captcha
if exists:
    simplex.click("Verify if you are human checkbox")
else:
    print("No captcha found")
simplex.press_enter()

When we log in to Odoo, we might see a captcha. If we do, we can click the checkbox to verify that we’re human.

Extractors

Simplex currently provides one extractor — extract_text.

extract_text.py
from simplex import Simplex

simplex = Simplex(api_key=os.getenv("SIMPLEX_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.