Scrapegraph-ai/examples/smart_scraper_graph
PeriniM c4dba42346
Some checks failed
Code Quality Checks / quality (push) Has been cancelled
Merge branch 'pre/beta' into refactoring-examples
2025-01-12 13:03:33 +01:00
..
ollama Merge branch 'pre/beta' into refactoring-examples 2025-01-12 13:03:33 +01:00
openai docs: improved readme + fix csv scraper imports 2025-01-08 04:16:38 +01:00
.env.example docs: improved readme + fix csv scraper imports 2025-01-08 04:16:38 +01:00
README.md docs: improved readme + fix csv scraper imports 2025-01-08 04:16:38 +01:00

Smart Scraper Example

This example demonstrates how to use Scrapegraph-ai for intelligent web scraping with automatic content detection and extraction.

Features

  • Intelligent content detection
  • Automatic data extraction
  • Content classification
  • Clean data output

Setup

  1. Install required dependencies
  2. Copy .env.example to .env
  3. Configure your OpenAI API key in the .env file

Usage

from scrapegraphai.graphs import SmartScraperGraph

graph = SmartScraperGraph()
results = graph.scrape("https://example.com")

Environment Variables

Required environment variables:

  • OPENAI_API_KEY: Your OpenAI API key