This repository contains examples of automating form submissions using Browserbase with different languages and frameworks. These examples accompany the Browserbase documentation on automating form submissions.
-
Clone this repository:
git clone https://github.com/browserbase/example-form-fill.git cd browserbase-form-fill-examples -
Choose your preferred language/framework:
Navigate to the Python implementation:
cd pythonFollow the setup instructions in python/README.md
Navigate to the Node.js implementation:
cd nodeChoose between two approaches:
- Playwright: Traditional Playwright implementation with Browserbase
- Stagehand: AI-powered automation using Browserbase's Stagehand
Both examples are in TypeScript and demonstrate form automation with different approaches.
Each implementation requires Browserbase credentials. Copy the appropriate .env.example file:
cp .env.example .envThen fill in your credentials:
BROWSERBASE_API_KEY: Your Browserbase API keyBROWSERBASE_PROJECT_ID: Your Browserbase project ID
Each implementation demonstrates how to:
- Create a Browserbase session
- Navigate to the form
- Fill in form fields
- Submit the form
- View the session replay