click_and_upload

def click_and_upload(
    self,
    element_description: str,
    file_path: str
) -> bool:
element_description
string
required

Description of the element to click on the page that opens the operating system’s file upload dialog (e.g., “Upload button”, “Choose file button”).

file_path
string
required

The path to the file you want to upload.

return
bool

Whether the file was uploaded successfully.

Sample Usage

from simplex import Simplex

simplex = Simplex(api_key="your_api_key")
simplex.create_session()
simplex.goto("https://www.simplex.sh/upload-example.html")
simplex.click_and_upload("Click or drag and drop", "simplex-logo.svg")

click_and_download

def click_and_download(
    self,
    element_description: str
) -> Tuple[bool, str, str]:
element_description
string
required

Description of the element to click on the page that opens the operating system’s file upload dialog (e.g., “Upload button”, “Choose file button”).

return
Tuple[str, str]

A tuple containing:

  • b64 (str): Base64 encoded file contents.
  • filename (str): Name of the downloaded file.

Sample Usage

from simplex import Simplex

simplex = Simplex(api_key="your_api_key")
simplex.create_session()
simplex.goto("https://www.simplex.sh/download-example.html")
simplex.click("Select action")
b64, filename = simplex.click_and_download("Download Logo")
print(filename)