Let’s say you have a file called simplex-logo.svg in the current directory. You can upload it with a file path:
Copy
Ask AI
from simplex import Simplexsimplex = 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")
or with a callable:
Copy
Ask AI
import osfrom simplex import Simplexsimplex = Simplex(api_key="your_api_key")simplex.create_session()simplex.goto("https://www.simplex.sh/upload-example.html")def get_file_from_disk(): return open("simplex-logo.svg", 'rb')simplex.click_and_upload( "Click or drag and drop", lambda: get_file_from_disk())
You can download a file by clicking on an element that starts a file download.
Copy
Ask AI
from simplex import Simplexsimplex = 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")
or with a callable:
Copy
Ask AI
import osfrom simplex import Simplexsimplex = Simplex(api_key="your_api_key")simplex.create_session()simplex.goto("https://www.simplex.sh/upload-example.html")def get_file_from_disk(): return open("simplex-logo.svg", 'rb')simplex.click_and_upload( "Click or drag and drop", lambda: get_file_from_disk())