This example demonstrates how to use Scrapegraph-ai for intelligent web scraping with automatic content detection and extraction.
- Intelligent content detection
- Automatic data extraction
- Content classification
- Clean data output
- Install required dependencies
- Copy
.env.example
to.env
- Configure your OpenAI API key in the
.env
file
from scrapegraphai.graphs import SmartScraperGraph
graph = SmartScraperGraph()
results = graph.scrape("https://example.com")
Required environment variables:
OPENAI_API_KEY
: Your OpenAI API key