mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-04 21:01:04 +08:00
605 B
605 B
XML Scraper Graph Example
This example demonstrates how to use Scrapegraph-ai to extract and process XML data from web sources.
Features
- XML data extraction
- XPath querying
- Data transformation
- Schema validation
Setup
- Install required dependencies
- Copy
.env.exampleto.env - Configure your API keys in the
.envfile
Usage
from scrapegraphai.graphs import XmlScraperGraph
graph = XmlScraperGraph()
xml_data = graph.scrape("https://example.com/feed.xml")
Environment Variables
Required environment variables:
OPENAI_API_KEY: Your OpenAI API key