@intuned/browser
v0.1.7
Published
runner package for intuned functions
Maintainers
Keywords
Readme
Intuned Browser SDK (TypeScript)
Intuned's TypeScript/JavaScript SDK for browser automation and web data extraction, designed to work seamlessly with the Intuned platform.
Installation
Using Yarn (Recommended)
yarn add @intuned/browserUsing npm
npm install @intuned/browserFeatures
The Intuned Browser SDK provides a comprehensive set of tools for browser automation and data extraction:
🤖 AI-Powered Extraction
- Structured Data Extraction - Extract structured data from web pages using AI with
extractStructuredData() - Smart Page Loading Detection - Determine when pages have fully loaded with
isPageLoaded() - Schema Validation - Validate extracted data against JSON schemas
🌐 Web Automation Helpers
- Navigation - Advanced URL navigation with
goToUrl() - Content Loading - Scroll to load dynamic content with
scrollToLoadContent() - Network Monitoring - Wait for network activity with
withNetworkSettledWait() - DOM Monitoring - Wait for DOM changes with
waitForDomSettled() - Click Automation - Click elements until exhausted with
clickUntilExhausted()
📄 Content Processing
- HTML Sanitization - Clean and sanitize HTML with
sanitizeHtml() - Markdown Extraction - Convert HTML to markdown with
extractMarkdown() - URL Resolution - Resolve relative URLs with
resolveUrl() - Date Processing - Parse and process dates with
processDate()
📁 File Operations
- File Downloads - Download files with
downloadFile() - S3 Integration - Upload and save files to S3 with
uploadFileToS3()andsaveFileToS3()
✅ Data Validation
- Schema Validation - Validate data structures with
validateDataUsingSchema() - Empty Value Filtering - Filter empty values with
filterEmptyValues()
⚡ Optimized Extractors
- High-Performance Extractors - Pre-built optimized extractors for common use cases
- Available via
@intuned/browser/optimized-extractors
Quick Start
import {
extractMarkdown,
sanitizeHtml,
goToUrl,
withNetworkSettledWait,
} from "@intuned/browser";
// Example: Extract and process web content
async function extractContent(page: Page) {
// Navigate to URL
await goToUrl(page, "https://example.com");
// Wait for network to settle
await withNetworkSettledWait(page, async () => {
// Your actions here
});
// Get and sanitize HTML
const html = await page.content();
const cleanHtml = sanitizeHtml(html);
// Extract markdown
const markdown = extractMarkdown(cleanHtml);
return markdown;
}AI-Powered Data Extraction
import { extractStructuredData } from "@intuned/browser/ai";
import type { JsonSchema } from "@intuned/browser/ai";
// Define your data schema
const schema: JsonSchema = {
type: "object",
properties: {
title: { type: "string" },
price: { type: "number" },
description: { type: "string" },
},
required: ["title", "price"],
};
// Extract structured data using AI
async function extractProductData(page: Page) {
const result = await extractStructuredData({
page,
schema,
prompt: "Extract product information from this page",
});
return result;
}Module Exports
The SDK provides multiple import paths for different features:
// Main helpers
import { goToUrl, sanitizeHtml /* ... */ } from "@intuned/browser";
// AI functions
import { extractStructuredData, isPageLoaded } from "@intuned/browser/ai";
// Optimized extractors
import /* extractors */ "@intuned/browser/optimized-extractors";Documentation
For detailed documentation on all functions and types, see the documentation.
Building from Source
# Install dependencies
yarn install
# Build the project
yarn build
# Run tests
yarn test
# Run tests with UI
yarn test:devSupport
For support, questions, or contributions, please contact the Intuned team at [email protected].
About Intuned
Intuned provides powerful tools for browser automation, web scraping, and data extraction. Visit intunedhq.com to learn more.
