Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
82272c6
jaysahnan/gro-811-recaptcha-template (#28)
jay-sahnan Dec 29, 2025
4654cd6
Add MFA Handling - TOTP Automation Template (#25)
jay-sahnan Jan 6, 2026
486093a
jaysahnan/gro-809-manual-mfa-with-contexts (#26)
jay-sahnan Jan 6, 2026
78b6631
Add basic-caching template (#27)
jay-sahnan Jan 6, 2026
80ce301
jaysahnan/gro-812-proxies-weather-template (#29)
jay-sahnan Jan 6, 2026
d75cd60
add go hackernews extraction template (#37)
Kylejeong2 Jan 20, 2026
1d7a23d
init commit (#42)
jay-sahnan Jan 22, 2026
a44a77d
init commit (#43)
jay-sahnan Jan 23, 2026
f96ef24
Add cartesia-form-filling template (#47)
shrey150 Jan 24, 2026
dc79a4b
Jaysahnan/gro 926 mfa template with playwright (#48)
jay-sahnan Jan 28, 2026
3ddbece
init commit (#45)
jay-sahnan Jan 28, 2026
ac1b0ed
jaysahnan/gro-954-amazon-global-price-comparision (#52)
jay-sahnan Feb 2, 2026
98d2b64
jaysahnan/gro-955-google-trends-template (#53)
jay-sahnan Feb 2, 2026
0dee558
jaysahnan/gro-951-sec-research-template (#51)
jay-sahnan Feb 2, 2026
ce0d85c
jaysahnan/gro-950-amazon-product-fetcher-template (#50)
jay-sahnan Feb 2, 2026
e290fd3
Exa-Browserbase-Template (#34)
jay-sahnan Feb 3, 2026
d7720fc
Migrate Python templates from Stagehand SDK v2 to v3 (#41)
shrey150 Feb 6, 2026
78b3022
init commit (#54)
jay-sahnan Feb 6, 2026
69cf92f
init commit (#55)
jay-sahnan Feb 6, 2026
d636d28
jaysahnan/gro-982-extend-browserbase-template (#56)
jay-sahnan Feb 10, 2026
3d8bfe4
Migrate extend-browserbase templates to Extend API v2026-02-09 (#58)
Addison-Huff Feb 10, 2026
436d0dd
Add Cerebras docs checker template (#60)
shrey150 Feb 13, 2026
a4cf6fb
Update typescript example for manual-mfa-with-contexts template (#63)
aq17 Feb 27, 2026
4d8f10c
Bump JS SDK to v2.7 and Python SDK to v1.5, remove project_id from AP…
derekmeegan Mar 11, 2026
0cf72cb
feat: add smart-fetch-scraper template (Fetch API + browser fallback)…
derekmeegan Mar 12, 2026
7e331d1
Extract image URLs with Stagehand and download images (#68)
aq17 Mar 23, 2026
8f83c62
Add getting-started-with-browserbase template (Search, Fetch, Session…
jay-sahnan Mar 25, 2026
43cc364
Fix broken documentation links across templates (#77)
jay-sahnan Mar 31, 2026
3b398f9
[CE-869] Add human-in-the-loop agent template (#72)
victlue Apr 1, 2026
79b3d52
Fix Build for Agent Template (#84)
victlue Apr 1, 2026
6f27b7f
Migrate Puppeteer quickstart into templates (#80)
jay-sahnan Apr 2, 2026
8fba11c
Migrate Selenium Python quickstart into templates repo with modernize…
jay-sahnan Apr 6, 2026
f971039
Add Selenium TypeScript quickstart template (#79)
jay-sahnan Apr 6, 2026
a8d0c96
Add Playwright quickstart templates for TypeScript and Python (#81)
jay-sahnan Apr 6, 2026
5a7c6f4
feat(browser-agent): adding browser agent demo from docs to templates…
Kylejeong2 Apr 6, 2026
7c5f999
Migrate templates to Model Gateway — remove separate model API keys, …
jay-sahnan Apr 7, 2026
1838511
Flatten README template list for agent discoverability (#86)
shrey150 Apr 16, 2026
c69c761
[DASH-1732] [templates] add build step to create javascript templates…
syd-shields May 13, 2026
89a9c46
[DASH-2089] [templates] smart-fetch-scraper: comment about Fetch mark…
bbclanker May 20, 2026
12168d5
Migrate all Stagehand templates to V4 (#101)
shrey150 Aug 21, 2026
3132dd8
Fix missing Browserbase SDK dependencies in generated templates (#103)
shrey150 Aug 23, 2026
35e35e8
Make direct template clones self-contained (#104)
shrey150 Aug 24, 2026
e40f0a7
Generalize CAPTCHA solving language across templates
Kylejeong2 Sep 25, 2026
568a21b
Rename basic-recaptcha directories to basic-captcha-solving
Kylejeong2 Sep 25, 2026
202314e
Merge dev branch - resolve template naming conflicts
Kylejeong2 Sep 25, 2026
bd37b6f
Remove old basic-recaptcha directories - migrated to basic-captcha-so…
Kylejeong2 Sep 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Ready-to-use automation templates for Stagehand and Browserbase. Each template h
| amazon-global-price-comparison | [TS](typescript/amazon-global-price-comparison) | [PY](python/amazon-global-price-comparison) | - | Compare Amazon product prices across multiple countries using geolocation proxies |
| amazon-product-scraping | [TS](typescript/amazon-product-scraping) | [PY](python/amazon-product-scraping) | - | Scrape the first 3 Amazon search results for a given query and return structured product data |
| basic-caching | [TS](typescript/basic-caching) | [PY](python/basic-caching) | - | Demonstrate how Stagehand's caching feature reduces cost and latency by reusing previously computed actions |
| basic-recaptcha | [TS](typescript/basic-recaptcha) | [PY](python/basic-recaptcha) | - | Automatic reCAPTCHA solving using Browserbase's built-in captcha solving capabilities |
| basic-captcha-solving | [TS](typescript/basic-captcha-solving) | [PY](python/basic-captcha-solving) | - | Automatic CAPTCHA solving using Browserbase's built-in captcha solving capabilities |
| browser-agent-demo | [TS](typescript/browser-agent-demo) | - | - | Browser agent that searches the web, fetches page content, and autonomously extracts information |
| browserbase-reducto | [TS](typescript/browserbase-reducto) | [PY](python/browserbase-reducto) | - | Download financial PDFs from websites and extract structured data using AI-powered document parsing |
| business-lookup | [TS](typescript/business-lookup) | [PY](python/business-lookup) | - | Research business registry records with a bring-your-own agent and Stagehand code mode |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Stagehand + Browserbase: Basic reCAPTCHA Solving
# Stagehand + Browserbase: Basic CAPTCHA Solving

Stagehand is the SDK for browser agents.

## AT A GLANCE

- Goal: Demonstrate automatic reCAPTCHA solving using Browserbase's built-in captcha solving capabilities.
- Goal: Demonstrate automatic CAPTCHA solving using Browserbase's built-in captcha solving capabilities.
- Automated Solving: Browserbase automatically detects and solves CAPTCHAs in the background. CAPTCHA solving is **enabled by default** - you don't need to set `solveCaptchas: true` unless you want to explicitly enable it (or set it to `false` to disable).
- Solving Time: CAPTCHA solving typically takes between 5-30 seconds depending on CAPTCHA type and complexity.
- Progress Monitoring: Listen for console messages (`browserbase-solving-started`, `browserbase-solving-finished`) to track captcha solving progress in real-time.
Expand All @@ -14,7 +14,7 @@ Stagehand is the SDK for browser agents.

## GLOSSARY

- solveCaptchas: Browserbase browser setting that enables automatic captcha solving for reCAPTCHA, hCaptcha, and other captcha types. Enabled by default for Basic and Advanced Stealth Mode.
- solveCaptchas: Browserbase browser setting that enables automatic CAPTCHA solving. Enabled by default for Basic and Advanced Stealth Mode.
Docs → https://docs.browserbase.com/features/stealth-mode#captcha-solving
- CAPTCHA solving: When a CAPTCHA is detected, Browserbase attempts to solve it automatically in the background, allowing your automation to continue without manual intervention.
- console messages: browser console events that indicate captcha solving status:
Expand All @@ -36,7 +36,7 @@ Browserbase provides integrated CAPTCHA solving to handle challenges automatical
- **Solving Time**: CAPTCHA solving typically takes between 5-30 seconds, depending on the CAPTCHA type and complexity
- **Default Behavior**: CAPTCHA solving is enabled by default for Basic and Advanced Stealth Mode
- **Proxies**: It's recommended to enable proxies when using CAPTCHA solving for higher success rates
- **Multiple Types**: Browserbase supports reCAPTCHA, hCaptcha, and other common captcha providers automatically
- **Multiple Types**: Browserbase supports common CAPTCHA types automatically

### Custom CAPTCHA Solving

Expand Down Expand Up @@ -78,10 +78,10 @@ browserbase_session_create_params = {"browser_settings": {"solveCaptchas": False

- Initializes Stagehand session with Browserbase
- Displays live session link for monitoring
- Navigates to Google reCAPTCHA demo page
- Waits for Browserbase to automatically solve the captcha
- Logs captcha solving progress messages
- Clicks submit button after captcha is solved
- Navigates to CAPTCHA demo page
- Waits for Browserbase to automatically solve the CAPTCHA
- Logs CAPTCHA solving progress messages
- Clicks submit button after CAPTCHA is solved
- Extracts and displays page content
- Prints the resulting page content for inspection
- Closes session cleanly
Expand All @@ -92,8 +92,8 @@ browserbase_session_create_params = {"browser_settings": {"solveCaptchas": False
- Captcha solving not enabled: ensure `solveCaptchas: True` is set in browserSettings (enabled by default)
- Solving timeout: allow up to 30 seconds for CAPTCHA solving to complete before timing out
- Proxies not enabled: enable proxies in browserSettings for higher CAPTCHA solving success rates
- Demo page inaccessible: verify the reCAPTCHA demo page URL is accessible and hasn't changed
- Console message timing: ensure console event listeners are set up before triggering the captcha
- Demo page inaccessible: verify the CAPTCHA demo page URL is accessible and hasn't changed
- Console message timing: ensure console event listeners are set up before triggering the CAPTCHA
- Custom captcha selectors: for non-standard CAPTCHAs, verify that `captchaImageSelector` and `captchaInputSelector` are correctly defined
- Import errors: activate your virtual environment if you created one
- ModuleNotFoundError: ensure all dependencies are installed via uvx install
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Solve and verify Google's reCAPTCHA demo with Stagehand V4."""
"""Solve and verify CAPTCHA challenge with Stagehand V4."""

import asyncio
import os
Expand Down Expand Up @@ -58,6 +58,6 @@ async def main() -> None:
try:
asyncio.run(main())
except Exception as error:
print(f"reCAPTCHA example failed: {error}")
print(f"CAPTCHA solving example failed: {error}")
print("Docs: https://docs.stagehand.dev/v4/first-steps/introduction")
raise
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "basic-recaptcha"
name = "basic-captcha-solving"
version = "0.1.0"
requires-python = ">=3.11,<3.14"
dependencies = ["python-dotenv==1.2.2", "stagehand==4.0.0"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Playwright + Browserbase: Basic reCAPTCHA Solving (Python)
# Playwright + Browserbase: Basic CAPTCHA Solving (Python)

## AT A GLANCE

- Goal: Demonstrate automatic reCAPTCHA solving using Playwright with Browserbase's built-in captcha solving capabilities.
- Goal: Demonstrate automatic CAPTCHA solving using Playwright with Browserbase's built-in captcha solving capabilities.
- Automated Solving: Browserbase automatically detects and solves CAPTCHAs in the background. CAPTCHA solving is **enabled by default** - you don't need to set `solveCaptchas: True` unless you want to explicitly enable it (or set it to `False` to disable).
- Timeout Handling: Includes 60-second timeout to prevent indefinite waits on captcha solving failures.
- Progress Monitoring: Listen for console messages (`browserbase-solving-started`, `browserbase-solving-finished`) to track captcha solving progress in real-time.
Expand All @@ -12,7 +12,7 @@

- Browserbase SDK: Python SDK for creating and managing browser sessions in Browserbase's cloud infrastructure.
Docs -> https://docs.browserbase.com/
- solveCaptchas: Browserbase browser setting that enables automatic captcha solving for reCAPTCHA, hCaptcha, and other captcha types. Enabled by default for Basic and Advanced Stealth Mode.
- solveCaptchas: Browserbase browser setting that enables automatic CAPTCHA solving. Enabled by default for Basic and Advanced Stealth Mode.
Docs -> https://docs.browserbase.com/features/stealth-mode#captcha-solving
- console messages: Browser console events that indicate captcha solving status:
- `browserbase-solving-started`: emitted when CAPTCHA detection begins
Expand Down Expand Up @@ -80,7 +80,7 @@ session = bb.sessions.create(

## QUICKSTART

1. `cd python/playwright/basic-recaptcha`
1. `cd python/playwright/basic-captcha-solving`
2. `uv venv venv`
3. `source venv/bin/activate` # On Windows: `venv\Scripts\activate`
4. `uv pip install .` # Install dependencies from pyproject.toml
Expand All @@ -94,21 +94,21 @@ session = bb.sessions.create(
- Creates Browserbase session with captcha solving enabled
- Displays session ID and live view link for monitoring
- Connects to browser via Chrome DevTools Protocol (CDP)
- Navigates to Google reCAPTCHA demo page
- Waits for Browserbase to automatically solve the captcha (with 60s timeout)
- Logs captcha solving progress messages
- Clicks submit button after captcha is solved
- Navigates to CAPTCHA demo page
- Waits for Browserbase to automatically solve the CAPTCHA (with 60s timeout)
- Logs CAPTCHA solving progress messages
- Clicks submit button after CAPTCHA is solved
- Verifies successful captcha solving by checking for success message
- Closes session cleanly and displays replay link

## COMMON PITFALLS

- Missing credentials: verify .env contains BROWSERBASE_API_KEY
- Browser not installed: run `playwright install chromium` to install browser binaries
- Captcha solving timeout: the template uses a 60-second timeout; increase if needed for complex CAPTCHAs
- CAPTCHA solving timeout: the template uses a 60-second timeout; increase if needed for complex CAPTCHAs
- No browser context: ensure the Browserbase session was created successfully before connecting
- Proxies not enabled: enable proxies in session creation for higher CAPTCHA solving success rates
- Demo page inaccessible: verify the reCAPTCHA demo page URL is accessible and hasn't changed
- Demo page inaccessible: verify the CAPTCHA demo page URL is accessible and hasn't changed
- Console message timing: ensure console event listeners are set up before navigating to the page
- Custom captcha selectors: for non-standard CAPTCHAs, verify that `captchaImageSelector` and `captchaInputSelector` are correctly defined
- Import errors: activate your virtual environment if you created one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Basic reCAPTCHA Solving with Playwright + Browserbase - See README.md for full documentation
# Basic CAPTCHA Solving with Playwright + Browserbase - See README.md for full documentation
#
# This template uses Playwright directly with the Browserbase SDK for lower-level browser control.
# For a higher-level API with natural language commands, see the Stagehand template instead.
Expand Down Expand Up @@ -36,16 +36,15 @@ def validate_env() -> str:


async def main():
print("Starting Playwright + Browserbase reCAPTCHA Example...")
print("Starting Playwright + Browserbase CAPTCHA Example...")

api_key = validate_env()

# Initialize the Browserbase SDK client.
bb = Browserbase(api_key=api_key)

# Create a new browser session with captcha solving enabled.
# solveCaptchas: Browserbase setting that enables automatic solving for
# reCAPTCHA, hCaptcha, and other captcha types.
# solveCaptchas: Browserbase setting that enables automatic CAPTCHA solving.
# Docs: https://docs.browserbase.com/features/stealth-mode#captcha-solving
print("Creating Browserbase session with captcha solving enabled...")
session = bb.sessions.create(
Expand Down Expand Up @@ -90,8 +89,8 @@ def handle_console(msg):

page.on("console", handle_console)

# Navigate to Google reCAPTCHA demo page to test captcha solving.
print("Navigating to reCAPTCHA demo page...")
# Navigate to CAPTCHA demo page to test CAPTCHA solving.
print("Navigating to CAPTCHA demo page...")
await page.goto(DEMO_URL, wait_until="domcontentloaded")

# Wait for Browserbase to solve the captcha automatically.
Expand All @@ -117,7 +116,7 @@ def handle_console(msg):
print(f"Page content: {page_content[:500] if page_content else 'None'}")

except Exception as error:
print(f"Error during reCAPTCHA solving: {error}")
print(f"Error during CAPTCHA solving: {error}")
raise

finally:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "playwright-basic-recaptcha"
name = "playwright-basic-captcha-solving"
version = "0.1.0"
description = "Basic reCAPTCHA solving with Playwright and Browserbase"
description = "Basic CAPTCHA solving with Playwright and Browserbase"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Stagehand + Browserbase: Basic reCAPTCHA Solving
# Stagehand + Browserbase: Basic CAPTCHA Solving

## AT A GLANCE

- Goal: Demonstrate automatic reCAPTCHA solving using Browserbase's built-in captcha solving capabilities.
- Goal: Demonstrate automatic CAPTCHA solving using Browserbase's built-in captcha solving capabilities.
- Automated Solving: Browserbase automatically detects and solves CAPTCHAs in the background. CAPTCHA solving is **enabled by default** - you don't need to set `solveCaptchas: true` unless you want to explicitly enable it (or set it to `false` to disable).
- Solving Time: CAPTCHA solving typically takes between 5-30 seconds depending on CAPTCHA type and complexity.
- Progress Monitoring: Listen for console messages (`browserbase-solving-started`, `browserbase-solving-finished`) to track captcha solving progress in real-time.
Expand All @@ -12,7 +12,7 @@

## GLOSSARY

- solveCaptchas: Browserbase browser setting that enables automatic captcha solving for reCAPTCHA, hCaptcha, and other captcha types. Enabled by default for Basic and Advanced Stealth Mode.
- solveCaptchas: Browserbase browser setting that enables automatic CAPTCHA solving. Enabled by default for Basic and Advanced Stealth Mode.
Docs → https://docs.browserbase.com/features/stealth-mode#captcha-solving
- CAPTCHA solving: When a CAPTCHA is detected, Browserbase attempts to solve it automatically in the background, allowing your automation to continue without manual intervention.
- console messages: browser console events that indicate captcha solving status:
Expand Down Expand Up @@ -41,7 +41,7 @@ Browserbase provides integrated CAPTCHA solving to handle challenges automatical
- **Solving Time**: CAPTCHA solving typically takes between 5-30 seconds, depending on the CAPTCHA type and complexity
- **Default Behavior**: CAPTCHA solving is enabled by default for Basic and Advanced Stealth Mode
- **Proxies**: It's recommended to enable proxies when using CAPTCHA solving for higher success rates
- **Multiple Types**: Browserbase supports reCAPTCHA, hCaptcha, and other common captcha providers automatically
- **Multiple Types**: Browserbase supports common CAPTCHA types automatically

### Custom CAPTCHA Solving

Expand Down Expand Up @@ -73,7 +73,7 @@ browserSettings: {

## QUICKSTART

1. cd basic-recaptcha
1. cd typescript/basic-captcha-solving
2. pnpm install
3. cp .env.example .env
4. Add your Browserbase API key to .env
Expand All @@ -83,11 +83,11 @@ browserSettings: {

- Initializes Stagehand session with Browserbase
- Listens for Browserbase captcha progress through Stagehand V4 console events
- Navigates to Google reCAPTCHA demo page
- Clicks submit button to trigger reCAPTCHA challenge
- Waits for Browserbase to automatically solve the captcha
- Logs captcha solving progress messages
- Clicks submit again after captcha is solved
- Navigates to CAPTCHA demo page
- Clicks submit button to trigger CAPTCHA challenge
- Waits for Browserbase to automatically solve the CAPTCHA
- Logs CAPTCHA solving progress messages
- Clicks submit again after CAPTCHA is solved
- Extracts and displays page content
- Prints the resulting page content for inspection
- Closes session cleanly
Expand All @@ -98,8 +98,8 @@ browserSettings: {
- Captcha solving not enabled: ensure `solveCaptchas: true` is set in browserSettings (enabled by default)
- Solving timeout: allow up to 30 seconds for CAPTCHA solving to complete before timing out
- Proxies not enabled: enable proxies in browserSettings for higher CAPTCHA solving success rates
- Demo page inaccessible: verify the reCAPTCHA demo page URL is accessible and hasn't changed
- Console message timing: ensure console event listeners are set up before triggering the captcha
- Demo page inaccessible: verify the CAPTCHA demo page URL is accessible and hasn't changed
- Console message timing: ensure console event listeners are set up before triggering the CAPTCHA
- Custom captcha selectors: for non-standard CAPTCHAs, verify that `captchaImageSelector` and `captchaInputSelector` are correctly defined

## HELPFUL RESOURCES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Basic reCAPTCHA Solving with Browserbase - See README.md for full documentation
// Basic CAPTCHA Solving with Browserbase - See README.md for full documentation

import "dotenv/config";
import { browserbase, Stagehand } from "@browserbasehq/stagehand";

async function main() {
// Initialize Stagehand with Browserbase for cloud-based browser automation.
// Enable captcha solving in browser settings for automatic reCAPTCHA handling.
// Enable captcha solving in browser settings for automatic CAPTCHA handling.

const solveCaptchas = true; // Set to false to disable automatic captcha solving (true by default)

Expand All @@ -23,8 +23,8 @@ async function main() {
console.log("Stagehand initialized successfully!");
const page = (await browser.context.pages())[0];

// Navigate to Google reCAPTCHA demo page to test captcha solving.
console.log("Navigating to reCAPTCHA demo page...");
// Navigate to CAPTCHA demo page to test CAPTCHA solving.
console.log("Navigating to CAPTCHA demo page...");
await page.goto("https://google.com/recaptcha/api2/demo");

// Wait for Browserbase to solve the captcha automatically.
Expand Down Expand Up @@ -60,8 +60,8 @@ async function main() {
console.log("Captcha solving is disabled. Skipping wait...");
}

// Click submit again after captcha is solved to complete the form submission.
console.log("Clicking submit button after captcha is solved...");
// Click submit again after CAPTCHA is solved to complete the form submission.
console.log("Clicking submit button after CAPTCHA is solved...");
await stagehand.act("Click the Submit button");

// Extract and display the page content after submission.
Expand All @@ -70,7 +70,7 @@ async function main() {
console.log("Page content:");
console.log(text);
} catch (error) {
console.error("Error during reCAPTCHA solving:", error);
console.error("Error during CAPTCHA solving:", error);
} finally {
// Always close session to release resources and clean up.
await stagehand.close();
Expand All @@ -80,7 +80,7 @@ async function main() {
}

main().catch((err) => {
console.error("Error in reCAPTCHA solving example:", err);
console.error("Error in CAPTCHA solving example:", err);
console.error("Common issues:");
console.error(" - Check .env file has BROWSERBASE_API_KEY");
console.error(" - Verify solveCaptchas is enabled in browserSettings");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "basic-recaptcha",
"name": "basic-captcha-solving",
"version": "1.0.0",
"private": true,
"type": "module",
Expand Down
Loading
Loading