📜 Command Reference
This page contains the full list of available commands in the Fuyu scripting environment.
These commands let you control the browser, interact with elements, extract data, and more.
🛠 Script Control
-
abort("reason")
Abort the script with a specific reason. -
quit_browser()
Close the current browser session immediately. -
print("text")
Print debug text to the job logs. -
wait(n)
Pause forn
seconds. -
wait_for("selector", n)
Wait up ton
seconds for an element matching the selector to appear. -
refresh()
Reload the current page.
🌐 Navigation
-
visit("url")
Navigate to the given URL. -
click("selector")
Click an element matching the selector. -
right_click("selector")
Right-click the matching element. -
scroll(y, x)
Scroll vertically byy
pixels and optionally horizontally byx
.
📡 HTTP Requests
-
http_get(url)
Perform a GET request. Returns a JSON response. -
http_post(url, body)
Perform a POST request with the specified body. Returns a JSON response.
🍪 Cookies
-
load_cookies()
Load previously saved cookies for the selected account. -
save_cookies()
Save the current cookies to the selected account.
🔐 Authentication
-
generate_otp(seconds)
Generate a one-time password (OTP) using the account's MFA secret.
Requires an account selected with an MFA secret configured.Accepts an optional parameter
min_valid_for
(0-30 seconds) that guarantees the returned OTP will be valid for at least that many seconds.
If specified, the function will wait until the current OTP validity period has enough time remaining before generating a new OTP.
By default (min_valid_for=0
), the OTP is generated immediately without waiting.
📄 Page Data
-
get_title()
Return the current page's title. -
find_element("selector")
Return anElement
object matching the selector. -
find_elements("selector")
Return a list of matchingElement
objects.
📤 Input & Output
-
record("key", "value")
Export a value as structured output. -
read("dataset-name")
Load a dataset by name as a list of objects.
🎲 Utilities
-
random(x, y)
Return a random number betweenx
andy
(inclusive). -
now()
Return the current time in ISO 8601 time formatHH:MM:SS
-
date()
Return the current date in ISO 8601 date formatYYYY-MM-DD
.
🧱 Built-in Functions
The following Python-style helpers are available globally:
len()
,min()
,max()
,sum()
,sorted()
,reversed()
lower()
,upper()
,split()
,join()
,replace()
any()
,all()
,range()
,in()
🔁 Type Conversion
int()
,str()
,float()
,bool()
,dict()
🧩 Element Object
The Element
object is returned from find_element()
or find_elements()
.
Text and Input
-
el.text
Get the inner text. -
el.input(value)
/el.send_keys(value)
Type text into the input. -
el.enter()
/el.backspace()
/el.clear()
Simulate keyboard input.
Interaction
-
el.click()
/el.double_click()
/el.right_click()
Mouse click variations. -
el.hover()
/el.focus()
/el.blur()
Simulate hover or focus changes. -
el.swipe(direction, distance)
Swipe the element in a direction (left
,right
,up
,down
).
Attributes and Scrolling
-
el.[attribute]
Access an element attribute (e.g.el.href
,el.src
, etc). -
el.scroll_y()
/el.scroll_x()
Scroll within the element. -
el.scroll_into_view()
Scroll the element into view.