Intelligent Website Crawler avatar

Intelligent Website Crawler

Under maintenance

Pricing

Pay per usage

Go to Apify Store
Intelligent Website Crawler

Intelligent Website Crawler

Under maintenance

Pricing

Pay per usage

Rating

0.0

(0)

Developer

HappiTap

HappiTap

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Categories

Share

AI-Enhanced Website Crawler

An intelligent website crawler that combines advanced crawling capabilities with AI-powered page classification, pattern detection, and content extraction. This enhanced version supports all the features of Apify's Website Crawler plus intelligent AI processing to minimize API usage and maximize data extraction efficiency.

๐Ÿš€ Key Features

Advanced Crawling Capabilities

  • Multiple Crawler Types: Supports Playwright (adaptive, Chrome, Firefox) and Puppeteer
  • Smart Content Extraction: Comprehensive data extraction including metadata, markdown, text, screenshots
  • Dynamic Content Handling: Handles JavaScript-rendered content, infinite scroll, and expandable elements
  • Sitemap Support: Automatically discovers and processes XML sitemaps
  • Proxy Support: Built-in Apify Proxy integration with rotation
  • Media Blocking: Optional blocking of images/videos for faster crawling

AI-Powered Intelligence

  • Automatic Page Classification: AI identifies page types (product, category, service, contact, blog, FAQ, etc.)
  • Pattern Learning: Learns page patterns to reduce AI API calls for similar pages
  • Smart Content Processing: Context-aware content extraction based on page type
  • Token Optimization: Aggressive content pruning to minimize AI API costs
  • Caching System: Reuses learned patterns for similar page structures

Comprehensive Output

  • Multiple Formats: HTML, Markdown, clean text, structured metadata
  • Screenshots: Optional full-page screenshots with cloud storage URLs
  • Performance Metrics: Load times, content metrics, accessibility info
  • AI Insights: Page classification, extracted patterns, processed content
  • Link Analysis: Internal/external link discovery with metadata

๐Ÿ“‹ Input Configuration

Basic Crawler Settings

{
"startUrls": [
{
"url": "https://example.com",
"method": "GET"
}
],
"crawlerType": "playwright:adaptive",
"maxCrawlPages": 100,
"maxCrawlDepth": 3,
"maxConcurrency": 10
}

AI Configuration

{
"enableAI": true,
"aiModel": "gpt-3.5-turbo",
"enablePatternLearning": true,
"patternSimilarityThreshold": 0.8,
"maxAICallsPerRun": 50,
"taskType": "auto"
}

Content Processing

{
"saveMarkdown": true,
"saveHtml": false,
"saveScreenshots": false,
"blockMedia": true,
"removeCookieWarnings": true,
"dynamicContentWaitSecs": 10
}

๐ŸŽฏ Task Types

  • auto: AI automatically detects the best processing approach
  • summarize: Creates comprehensive content summaries
  • extractProducts: Extracts product information (name, price, features, specs)
  • extractServices: Extracts service offerings and descriptions
  • extractFAQs: Extracts question-answer pairs and help content
  • extractContacts: Extracts contact information and business details

๐Ÿ“Š Output Format

{
"url": "https://example.com/product/123",
"timestamp": "2024-01-15T10:30:00Z",
"crawlTime": 2500,
"metadata": {
"title": "Product Name - Company",
"description": "Product description from meta tags",
"ogTitle": "Open Graph title",
"schema": ["JSON-LD structured data"]
},
"content": {
"html": "<html>...</html>",
"markdown": "# Product Name\n\nProduct description...",
"text": "Clean text content",
"title": "Product Name",
"headings": [
{"level": 1, "text": "Product Name", "id": "heading-0"}
],
"links": [
{"url": "https://example.com/related", "text": "Related Product"}
],
"images": [
{"url": "https://example.com/image.jpg", "alt": "Product image"}
]
},
"screenshots": {
"key": "screenshot-1234567890.png",
"url": "https://api.apify.com/v2/key-value-stores/.../screenshot-1234567890.png"
},
"ai": {
"classification": {
"type": "product",
"confidence": 0.95,
"reasoning": "Page contains product information with pricing and specifications"
},
"patterns": {
"selectors": {
"title": ".product-title",
"price": ".price",
"description": ".product-description"
},
"confidence": 0.85
},
"processedContent": {
"processed": true,
"content": "Structured extracted data based on page type"
}
},
"performance": {
"loadTime": 1200,
"domContentLoaded": 800,
"firstPaint": 600
},
"accessibility": {
"hasAltTexts": 5,
"missingAltTexts": 1,
"headingStructure": ["h1", "h2", "h2", "h3"]
}
}

๐Ÿง  AI Features in Detail

Page Classification

The AI automatically identifies page types:

  • Product pages: Individual product listings with specs and pricing
  • Category pages: Product category or listing pages
  • Service pages: Service descriptions and offerings
  • Contact pages: Contact info, about us, company details
  • Blog pages: Articles, news, blog posts
  • FAQ pages: Help, support, and FAQ content
  • Home pages: Landing pages and homepages

Pattern Learning

  • Analyzes page structure and identifies data extraction patterns
  • Caches successful patterns for reuse on similar pages
  • Reduces AI API calls by up to 80% on sites with consistent structure
  • Learns CSS selectors for key data elements

Smart Content Processing

  • Adapts processing strategy based on detected page type
  • Extracts relevant structured data automatically
  • Minimizes token usage through intelligent content pruning
  • Provides confidence scores for all AI decisions

๐Ÿ”ง Advanced Configuration

{
"startUrls": [
{ "url": "https://example.com" }
],
"taskType": "extractServices",
"followInternalLinks": true,
"maxDepth": 2
}

Extract Products from Multiple URLs

{
"startUrls": [
{ "url": "https://shop1.com" },
{ "url": "https://shop2.com" }
],
"taskType": "extractProducts"
}

How It Works

  1. Content Extraction: Uses Puppeteer to load pages and Cheerio to extract clean content
  2. Intelligent Processing: LangChain processes content based on the specified task type
  3. Structured Output: Returns processed content with metadata and original URL
  4. Optional Crawling: Can follow internal links to gather more comprehensive data

Installation

  1. Clone this repository
  2. Install dependencies: npm install
  3. Set your OPENAI_API_KEY environment variable
  4. Run the actor: npm start

Development

  • npm start - Run the actor
  • npm run format - Format code with Prettier
  • npm run lint - Run ESLint
  • npm run lint:fix - Fix ESLint issues

Architecture

  • src/main.js - Main entry point and input validation
  • src/routes.js - Request routing
  • src/handlers/websiteScraper.js - Main scraping logic
  • src/services/langchainService.js - LangChain integration and task processing
  • src/puppeteerLauncher.js - Puppeteer browser configuration