LLM Scraper is a TypeScript library that extracts structured data from webpages using large language models.
The tool solves the problem of converting unstructured web content into machine-readable data by combining browser automation with LLM reasoning. It works by loading a webpage through Playwright, optionally processing it into various formats (HTML, markdown, text, or screenshots), and then passing the content to an LLM with a schema definition to extract and structure the data according to your specifications.
Developers should choose this tool when they need flexible, schema-driven web scraping that can handle diverse page layouts without brittle CSS selectors or DOM parsing logic. It suits projects where the target data structure is well-defined but page markup varies, or where content requires semantic understanding rather than pattern matching. The library supports multiple LLM providers including OpenAI, Anthropic, Google, Groq, and Ollama, and allows schemas to be defined using either Zod or JSON Schema. It includes streaming support for partial object extraction and a code-generation feature that produces reusable Playwright scripts based on your extraction schema.
The project maintains active engagement with community contributions and bug reports through its issue and pull request process. Development has progressed to a major version update that integrates with current tooling standards. The codebase includes multiple working examples demonstrating different extraction scenarios, providing clear reference implementations for common use cases.