Contact Now
AgentsMar 04, 2026

Building Resilient Scraping Agents

Using Playwright and VLMs to navigate dynamic single-page applications.

The Fragility of BeautifulSoup

Traditional BeautifulSoup and Selenium scrapers are brittle. They break the moment a website changes its CSS classes, updates its React component tree, or obfuscates its DOM.

Visual Web Agents

We built an autonomous scraping agent using Playwright. Instead of relying on rigid HTML selectors, the agent uses a Vision-Language Model.

We feed the VLM a screenshot of the rendered page alongside a system prompt: "You are controlling a browser. Based on the screenshot, give me the exact coordinates to click to export the financial data to CSV."

// Simplified Playwright VLM integration const { chromium } = require('playwright'); (async () => { const browser = await chromium.launch(); const page = await browser.newPage(); await page.goto('https://finance-dashboard.example.com'); // Take screenshot and send to VLM API const screenshot = await page.screenshot(); const { x, y } = await askVlmWhereToClick(screenshot, "Export to CSV button"); // Click based on visual coordinates, completely ignoring the DOM structure await page.mouse.click(x, y); })();

Because the agent visually identifies elements just like a human does, it is incredibly robust to UI redesigns, dynamic rendering, and anti-scraping obfuscation.