Skip to main content
When websites change their DOM structure, your browser automations break. Instead of manually debugging selectors, you can use Claude Code with Browserbase to automatically detect and fix these issues in CI/CD.
This GitHub Action creates a Browserbase session, lets Claude Code inspect the live DOM, and opens a PR with fixed selectors.

The problem

Your automation suddenly stops working because the website changed their CSS classes:

The solution

Add a GitHub Action that uses Claude Code with Browserbase to automatically fix it:

Trigger options

The example above uses manual dispatch and a schedule, but you can trigger self-healing from various sources:
Trigger the workflow when your monitoring detects automation failures:
Then call the GitHub API from your observability platform (Datadog, PagerDuty, Grafana, etc.):
Access the payload in your workflow:
The most powerful setup combines observability alerts with self-healing. When your monitoring detects increased error rates or missing data, it automatically triggers Claude Code to investigate and fix the issue.

Required secrets

Add these secrets to your GitHub repository:

How it works

1

Trigger

The action runs on manual dispatch or a weekly schedule.
2

Setup

Installs the browse CLI, Claude Code, and Browserbase skills.
3

Browser Session

Creates a cloud browser session via Browserbase API.
4

AI Analysis

Claude Code connects to the browser, inspects the live DOM with browse snapshot, and identifies correct selectors.
5

Fix & PR

Updates the code and opens a pull request with the changes.

The result

Claude Code automatically:
  1. Opens a real browser via Browserbase
  2. Inspects the current DOM structure
  3. Identifies the correct selectors
  4. Updates your code and opens a PR
This pattern works for any web automation that breaks due to DOM changes, including login flows, data extraction, form submissions, and more.