Quickstart: Playwright
Connect to a cloud browser via Playwright and Browserbase, navigate a real website, interact with UI elements, and extract page content.
Send this template to your email, or view it on your desktop for the source code.
Get started with Playwright + Browserbase
Get up and running with Playwright and Browserbase in a single script. Connect to a cloud browser via CDP, navigate to a real website (SFMOMA), interact with UI elements like search overlays and navigation links, and extract structured content from the page. No AI model required — just Playwright and your Browserbase API key.
Steps
- Create a Browserbase cloud browser session and connect via CDP using Playwright
- Navigate to the SFMOMA homepage and print the page title
- Open and close the search overlay by clicking UI buttons
- Click the Membership link and navigate to the membership page
- Extract the heading and intro text from the membership page