Overview
This guide demonstrates how to scrape data from websites that require user authentication by using persistent browser sessions. You’ll learn to launch a browser session to create a browser profile, authenticate manually, and then run automated tasks using that authenticated profile.1
Launch Browser Session
First, open a browser session to create a new browser profile that will persist your authentication cookies. This session will return a The
profile_id and live_url for manual authentication.Python
live_url opens an interactive browser window where you can manually authenticate.2
Authenticate Manually
Open the
live_url in your browser and manually log in to Gmail:- Navigate to the live URL provided by the session
- Go to gmail.com in the browser
- Enter your email address and password
- Complete any two-factor authentication if required
- Verify you’re successfully logged in to your Gmail inbox
3
Close Browser Session
Use the returned
live_id to close the interactive session and save the browser profilePython
If the browser session is not manually closed, the profile is saved when the 5 minutes time limit is reached and the browser session closed automatically.
4
Run Automated Task
Now use the authenticated profile to run an automated task. The agent will access Gmail as a logged-in user and retrieve your last email.The agent will automatically use the stored authentication from your profile to access Gmail and extract the requested information.
Python
Key Benefits
- Persistent Authentication: Profiles maintain login state across multiple tasks
- Manual Control: You handle the authentication process manually for security
- Automated Execution: Once authenticated, agents can run complex tasks automatically
- Session Reuse: The same profile can be used for multiple related tasks
Best Practices
- Use descriptive profile IDs for better organization
- Keep profiles secure and don’t share profile IDs
- Test authentication manually before running automated tasks
- Handle rate limits and be respectful to the target website
Browser profiles persist cookies and authentication state, making them perfect for accessing protected content while maintaining security through manual authentication.
Community
Join Discord
Join our community for support and showcases