rensan-browser
v0.2.5
Published
AI-powered browser for agents — navigate, click, type, read, see images, capture requests
Maintainers
Readme
rensan-browser
AI-powered browser for agents — navigate, click, type, read, see images, capture requests.
Built on Playwright + Claude. Designed for AI agents that need to interact with websites and intercept their API traffic.
Install
npm install rensan-browser playwright
npx playwright install chromiumQuick start
import { RensanBrowser } from 'rensan-browser'
const browser = new RensanBrowser({ apiKey: 'sk-ant-...' })
const session = await browser.open('https://example.com')
// Read text from the page
const headline = await session.read('the main headline')
// Click anything — AI finds it
await session.click('the Accept cookies button')
// Fill any input — AI finds it
await session.fill('Buenos Aires', 'the city search input')
// Take a screenshot (base64 JPEG)
const img = await session.screenshot()
// Capture JSON requests fired by the page
const requests = await session.capture(async () => {
await session.fill('BUE', 'origin airport')
await session.click('search flights button')
})
// requests = [{ url, data, score }, ...]
await session.close()
await browser.close()API
new RensanBrowser(config)
| Option | Type | Default | Description |
|---|---|---|---|
| apiKey | string | required | Anthropic API key |
| model | string | claude-haiku-4-5 | Vision model for AI decisions |
| headless | boolean | true | Run browser headless |
| timeout | number | 25000 | Default navigation timeout (ms) |
Browser methods
browser.open(url, options?) // open session and navigate
browser.newSession() // open blank session
browser.openMany(urls[], options?) // multiple sessions in parallel
browser.run(async (session) => ...) // auto-closing session
browser.close() // close browserSession methods
// Navigation
session.goto(url, options?)
// Interaction — AI finds the element via vision
session.click(goal) // 'the login button'
session.fill(value, goal, options?) // ('BUE', 'origin airport input')
session.type(text, options?) // type at current focus
session.moveTo(goal | { x, y }) // move cursor
// Reading
session.read(goal?) // 'the product price' or all text
session.screenshot() // base64 JPEG
// Scrolling
session.scroll('down' | 'up', options?)
// Request capture
session.capture(async () => { ... }) // returns CapturedRequest[]
session.startCapture()
session.stopCapture()
session.capturedRequests
// Lifecycle
session.wait(ms)
session.close()Parallel sessions
const [s1, s2, s3] = await browser.openMany([
'https://skyscanner.com',
'https://kayak.com',
'https://despegar.com',
])
const results = await Promise.all([
s1.capture(async () => s1.fill('BUE', 'origin')),
s2.capture(async () => s2.fill('BUE', 'origin')),
s3.capture(async () => s3.fill('BUE', 'origin')),
])Request scoring
Captured requests are automatically ranked by relevance — first-party API calls score higher than tracking, ads, and analytics. No hardcoded domain lists.
const requests = await session.capture(async () => {
await session.goto('https://news-site.com')
})
// requests[0] is the most likely real data APIHow AI interaction works
- Layer 1 — Playwright semantic (free): tries
getByRole('searchbox'),getByRole('textbox')and common patterns. Works for most standard inputs. - Layer 2 — Claude Haiku vision (~$0.001): takes a screenshot, sends it to Haiku, gets back a CSS selector. Works for any page layout.
Total cost per interaction: ~$0.001 with Haiku.
License
MIT
