Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

FAQ

General

What is b4n1web?

An ultra-lightweight headless browser engine with a single Rust binary and 4 language SDKs (Python, JavaScript/TypeScript, Java, C#). Designed for AI agents and web scraping.

How is it different from Selenium/Playwright/Puppeteer?

FeatureSeleniumPlaywrightb4n1web
Binary size~200MB+~200MB+~9MB
InstallMultiple depsMultiple depspip install
Startup~5s~3sInstant
LanguagesManyMany4 SDKs
AI Agent ready✅ MCP

Which mode should I use?

START: Do you need screenshots or interaction (click/type/wait)?
  YES → RENDER MODE
  NO  → Does the site load content via JavaScript?
    YES → JS MODE
    NO  → LIGHT MODE

Installation

“Binary not found” error

The SDK bundles binaries for all 6 platforms. If you see this:

  1. Reinstall: pip install --upgrade b4n1-web
  2. Or manually: curl -sL https://b4n1.com/install | bash

Python: “No module named ‘b4n1web’”

pip install b4n1-web
# Note: package name has hyphen, import uses underscore
from b4n1web import AgentBrowser

npm: “Cannot find module ‘b4n1-web’”

npm install b4n1-web
# or
pnpm add b4n1-web

Runtime Issues

“Chromium not found” (Render mode)

Render mode needs Chromium. It auto-downloads (~160MB) on first use.

Solutions:

  1. Wait for auto-download (requires internet)
  2. Use system Chromium:
    export B4N1WEB_CHROMIUM=/usr/bin/chromium
    
  3. Linux ARM64 (Raspberry Pi):
    sudo apt install chromium-browser
    export B4N1WEB_CHROMIUM=/usr/bin/chromium
    

“Permission denied” on binary

chmod +x ~/.local/bin/b4n1web

“Version mismatch” warning

⚠️ Version mismatch: SDK v0.9.5 requires binary v0.9.5, but found v0.9.4

Update both:

pip install --upgrade b4n1-web
curl -sL https://b4n1.com/install | bash

SDK-Specific

Python: Async vs Sync

# Sync (blocking)
browser = AgentBrowser()
page = browser.goto("https://example.com")

# Async (non-blocking)
browser = AgentBrowser()
page = await browser.goto_async("https://example.com")

JavaScript: CommonJS vs ESM

// ESM (recommended)
import { AgentBrowser } from 'b4n1-web';

// CommonJS
const { AgentBrowser } = require('b4n1-web');

C#: Dependency Injection

services.AddSingleton<IAgentBrowser>(provider => 
    new AgentBrowser(new BrowserOptions { Mode = BrowserMode.Light }));

Java: Spring Boot

@Bean
public AgentBrowser agentBrowser() {
    return new AgentBrowser(new BrowserOptions().setMode(BrowserMode.LIGHT));
}

Platform Support

PlatformBinaryChromium
Linux x86_64
Linux ARM64
macOS Intel
macOS Apple Silicon
Windows x86_64
Windows ARM64

MCP Server

“Connection refused”

# Start daemon first
b4n1web daemon start
b4n1web mcp

“Tool not found”

Update to latest version:

curl -sL https://b4n1.com/install | bash

Performance

ModeRAMStartupUse Case
Light~15MBInstant90% of scraping
JS~15MBInstantSPA content
Render~100MB~2sScreenshots, interaction

Still Stuck?

  1. Check GitHub Issues
  2. Search existing issues
  3. Create new issue with:
    • OS + version
    • b4n1web --version
    • Full error message
    • Minimal reproduction code