You can create a session with the create_session method in the SDK. This is also where you pass the optional login session data from the simplex login CLI.

from simplex import Simplex

simplex = Simplex(api_key="your_api_key")
# By default, we print the livestream URL to the console.
# Set create_session(show_in_console=False) to hide it.
session_id, livestream_url = simplex.create_session()

# Navigate to Bing
simplex.goto("https://bing.com")
# add a 30 second wait to keep the session open while viewing it
simplex.wait(30000) 
simplex.close_session()

Once you run the above code, you’ll get a livestream URL that you can use to view the session.

Executing create-session.py.

You can now interact with the session using Simplex’s Actions and Extractors.