Browserbase have just launched a new tool based on Playwright, called Stagehand.
Stagehand is the AI-powered successor to Playwright, offering three simple APIs (act, extract, and observe) that provide the building blocks for natural language driven web automation.
Stagehand offers three API methods:
act
- Perform an action on the page
extract
- Extract data from the page
observe
- Show the possible actions that can be performed on the page
Each Stagehand command takes a natural language string as input and uses a language model (currently Anthropic or OpenAI models) to convert the natural language into a Playwright script and then executes it.
One advantage of using Stagehand is that we don't need any knowledge of how the DOM is structured to interact with the page. This is perfect to test the auto-generated React Todo Apps.