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.cgtrader.com/3d-models/aircraft/commercial-aircraft/boeing-787-8-5f56fa4f-4ca5-42b8-9ffa-154fb2215928")

succeeded, text = simplex.extract_text("type of license")
if succeeded and "no ai" not in text.lower():
    simplex.click("add to cart")