from browser_use import BrowserUse
client = BrowserUse()
# 1. create a profile to hold the login
profile = client.browser_profiles.create(name="my-gmail")
# 2. log in once (the profile now remembers it)
client.agents.browser_use.run(
task="Log into gmail.com with email me@example.com and password ...",
browser={"profile_id": profile.id},
)
# 3. reuse forever — already logged in
run = client.agents.browser_use.run(
task="Summarize my unread emails",
browser={"profile_id": profile.id},
)
print(run.output)