Skip to main content
Follow this quickstart to connect your agent to the web through Grasp’s cloud browser, capture a live view, and print fresh Hacker News headlines with Playwright.

Prerequisites

  • Node.js 18+ (for JavaScript/TypeScript users) or Python 3.8+ (for Python users) installed.
  • Get your API key from the Grasp Dashboard.

Step 1: Initialize Your Project

Create a new project directory.
Install the Grasp SDK, Playwright, and dotenv.
Create a .env file to store your API key. The Grasp SDK will automatically load this key.

Step 2: Launch a Cloud Browser

Create a file to get started. This script will initialize the Grasp SDK and create a new container, which is your isolated cloud browser environment.

Step 3: Automate with Playwright

Now, let’s use Playwright to connect to the cloud browser and automate a task. We’ll scrape the top 5 headlines from Hacker News.

Step 4: Use a Proxy

To route the browser’s traffic through a specific country, you can enable the proxy feature when creating the container.

Step 5: Run Your Agent

Now, run the complete script from your terminal.
You should see the following output: