# API Reference Minima provides a rich, semantic API to interact with the browser seamlessly. ## Core Engine ### `@browser_session` A decorator that automates the setup, execution context, and teardown of a browser session. ```python from minima.engine.context import browser_session @browser_session( url="https://example.com", browser_type="chrome", # 'chrome' or 'firefox' maximize=True, headless=False, kill_browser=True ) def my_script(): pass ``` ### `Browser` A high-level interface for browser-level actions. - `Browser.accept_alert(timeout=5)` - `Browser.switch_to_new_tab()` - `Browser.switch_to_original_tab()` - `Browser.close_current_tab()` --- ## UI Elements All UI elements inherit from the base `UIElement` class. Elements are located using keyword arguments that correspond to HTML attributes (e.g., `id="btn"`, `class_="primary"`, `text="Submit"`). ### Base Actions (`UIElement`) Available on all derived widgets (Button, Dropdown, Text, etc.): - `.click(timeout=10)` - `.double_click(delay=0.1, timeout=10)` - `.hover(timeout=10)` - `.unhover(timeout=10)` - `.scroll_to(timeout=10)` - `.drag_to(target_widget, timeout=10)` - `.properties(timeout=10)` -> `dict` - `.get_attribute(attribute_name, timeout=10)` -> `str` ### `Button` Represents clickable buttons `