Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 Public Browser Self-Correcting Scraper

Public Browser is a high-speed tool that lets AI agents control Google Chrome directly using accessibility trees instead of fragile web links. This project creates an AI scraping agent that automatically adapts when website layouts and buttons change, ensuring your data extraction never breaks.

Step 1: Input Step 2: AI Action Step 3: Result
Target web address & prompt instruction Reads accessibility tree & auto-detects changed elements Clean structured markdown report saved

πŸ€– 1-Click Agent Setup & Execution Prompts

You can let your Antigravity Agent execute the entire setup and configuration automatically by pasting these exact step-by-step prompts into the chat window:


⚑ Step 1 Prompt: Install Dependencies & Verify MCP Binary

Paste this into Antigravity Chat to auto-install all Python and Node.js dependencies:

Please execute terminal command `pip install -r requirements.txt; npx -y public-browser@latest --help` in the project working directory to install all Python dependencies and pre-fetch the public-browser package.

βš™οΈ Step 2 Prompt: Auto-Register Public Browser MCP in mcp.json

Paste this into Antigravity Chat to let the agent auto-configure your MCP settings file:

Please check `%USERPROFILE%\.gemini\antigravity-ide\mcp.json` (or `~/.gemini/antigravity-ide/mcp.json` on Mac/Linux). Add or merge `"public-browser"` under `"mcpServers"` with:
{
  "mcpServers": {
    "public-browser": {
      "command": "npx",
      "args": ["-y", "public-browser@latest"]
    }
  }
}
Save the file and confirm once the server entry is registered.

🌐 Step 3 Prompt: Verify Navigation & Interactive Tree

Paste this into Antigravity Chat to test live browser control via Accessibility Trees:

Open https://mcp-test.second-truth.com using Public Browser tools. Call view_page to read the interactive accessibility tree and list all input fields with their ref IDs.

πŸ“ Step 4 Prompt: Self-Correcting Form Submission

Paste this into Antigravity Chat to test adaptive form filling:

Fill out the contact form on the page using fill_form. If any CSS selector breaks or button IDs have changed, query view_page to find the updated element ref dynamically and submit the form.

πŸ“Š Step 5 Prompt: Dynamic Data Extraction & Self-Correction Report Generation

Paste this into Antigravity Chat to run a full self-correcting extraction and generate outputs/outputs.md:

Open https://mcp-test.second-truth.com using Public Browser tools. Read the accessibility tree using view_page to discover interactive elements and submit the form dynamically. Then extract all input node labels, button refs, and form values, and save a formatted Markdown summary report into `outputs/outputs.md` containing execution summary tables and self-correction event audits.

πŸ¦™ Alternative Option: Using Local Ollama Models

You can run this entire self-correcting web scraper 100% offline and locally on your PC by pairing Public Browser with Ollama.

Step 1: Download Model Checkpoint

Run this command in your terminal to save model files inside the models/ directory:

ollama pull llama3.1:8b

Step 2: Register Local Modelfile

Register the local scraper model in Ollama using the included Modelfile:

ollama create public_browser_scraper -f Modelfile

Now select public_browser_scraper in your local LLM dropdown and run prompts offline with zero cloud API costs!


⚑ Quick Start & Installation

Run this single command in your Windows PowerShell terminal to install all dependencies and initialize Public Browser:

pip install -r requirements.txt; npx -y public-browser@latest

πŸ“ File Structure

β”œβ”€β”€ outputs/
β”‚   └── outputs.md
β”œβ”€β”€ Modelfile
β”œβ”€β”€ requirements.txt
└── README.md

πŸ› οΈ File Explanations

  • outputs/outputs.md: Generated Markdown report containing self-correcting web extraction data, node audits, and form fields.
  • Modelfile: Configuration file for registering local Ollama models with custom browser automation instructions.
  • requirements.txt: List of required Python packages (publicbrowser).
  • README.md: Complete documentation and step-by-step setup guide.

🎯 5 Practical Use Cases

  1. E-Commerce Price Monitoring: Automatically track product prices across shopping sites even when retailers redesign their store pages.
  2. Automated Form Submissions: Fill multi-step web forms for job applications or event registrations in a single call.
  3. MFA Login Session Scraping: Connect to your existing logged-in Chrome profile to scrape data behind private dashboard logins.
  4. Competitor Intelligence Gathering: Extract articles, press releases, and product updates reliably without fixing broken CSS selectors.
  5. Quality Assurance Web Testing: Run automated web audits that simulate realistic user interaction flows across dynamic web applications.

πŸš€ 5 Future Features

  1. Auto-Captive Solvers: Native integration with visual vision models to auto-solve complex web puzzles.
  2. Multi-Tab Parallel Crawling: Concurrent data extraction across multiple background Chrome tabs.
  3. Scheduled Automated Audits: Built-in cron triggers for continuous website health monitoring.
  4. Export to Databases: Direct database streaming to PostgreSQL and SQLite databases.
  5. Visual Diff Inspector: Automatic visual side-by-side screenshot comparisons before and after UI redesigns.

🏷️ Keywords & SEO

Public Browser Chrome AI Tool Browser Automation Playwright Alternative MCP Server Accessibility Tree Scraping Python PublicBrowser Self-Correcting Scraper Ollama Browser Automation Claude Code Automation

About

Public Browser: New Chrome AI Tool Just Got 40% Faster Browser Automation! (Playwright Killer) - High-speed Chrome AI browser automation MCP server and Python Script API.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors