Quickstart: Playwright + Browserbase

Connect to a cloud browser via Playwright and Browserbase, navigate a real website, interact with UI elements, and extract page content.

Quickstart: Playwright + Browserbase demo
Copy prompt to run with your AI agent

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

  1. Create a Browserbase cloud browser session and connect via CDP using Playwright

  2. Navigate to the SFMOMA homepage and print the page title

  3. Open and close the search overlay by clicking UI buttons

  4. Click the Membership link and navigate to the membership page

  5. Extract the heading and intro text from the membership page