Optexity can download files from websites and upload files to forms.
Download Methods
Click to Download
Attach freeform JSON to a download when using expect_download. Values support the same {variable} substitution as other action fields:
Metadata is keyed by the final filename and returned on callbacks as optional downloads_with_metadata (see Callbacks). On interaction actions, only click_element / select_option with expect_download support this field; from a Python script, pass metadata= to ctx.save_download().
Save a File from a Python Script
When a script has already fetched or assembled the bytes — an API response, a
CSV it built, pages it reassembled into a PDF — it can register the file
directly instead of routing it back through the browser:
The file is uploaded and its metadata persisted exactly as for expect_download
downloads. This replaces the older workaround of base64-ing bytes into a Blob,
injecting an <a download> anchor, and adding a second click_element node to
click it — which cost a screenshot, an axtree capture and a trajectory upload per
file.
See Python Script Action
for the full ctx reference.
Select to Download
Save Page as PDF
Capture current page or specific URL as PDF:
Multiple Downloads
Use for_loop_node to download multiple files:
Use variable substitution in download_filename to create unique filenames.
When the download links are on the page but their identifiers aren’t known in advance, iterate a locator instead of a variable and use the loop index for the filename:
See For Loop Node for the locator loop’s placeholders and timing.
Upload Files
The file source must be exactly one of file_path or file_url. Setting both, or neither, is rejected by the schema.
Upload from a local path:
Upload from a public URL (downloaded to a temp file just before upload, then cleaned up):
Download Storage
Downloaded files are stored in the task’s downloads directory:
Waiting for Downloads
Optexity automatically waits for downloads when expect_download=true. For large files, increase timing:
Failure on Missing Download
When a node expects a file but none is produced, the task fails rather than
silently continuing. This applies to both download mechanisms:
expect_download=true (click_element / select_option):
download_url_as_pdf:
If a download is slow, increase end_sleep_time (see below) so the file has
time to finish before the timeout triggers a failure.
Best Practices