Sessions are remote browser instances that allow you to connect to the web.
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.
Copy
Ask AI
from simplex import Simplexsimplex = 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 Bingsimplex.goto("https://bing.com")# add a 30 second wait to keep the session open while viewing itsimplex.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.