LlamaIndex Tool - Scrapegraph
This tool integrates Scrapegraph with LlamaIndex, providing intelligent web scraping capabilities with structured data extraction.
Installation
pip install llama-index-tools-scrapegraph
Usage
First, import and initialize the ScrapegraphToolSpec:
from llama_index.tools.scrapegraph import ScrapegraphToolSpec
scrapegraph_tool = ScrapegraphToolSpec()
Available Functions
The tool provides the following capabilities:
- Smart Scraper
from pydantic import BaseModel
# Define your schema (optional)
class ProductSchema(BaseModel):
name: str
price: float
description: str
schema = [ProductSchema]
# Perform the scraping
result = scrapegraph_tool.scrapegraph_smartscraper(
prompt="Extract product information",
url="https://example.com/product",
api_key="your-api-key",
schema=schema, # Optional
)
- Markdownify
Convert webpage content to markdown format:
markdown_content = scrapegraph_tool.scrapegraph_markdownify(
url="https://example.com", api_key="your-api-key"
)
- Local Scrape
Extract structured data from raw text:
text = """
Your raw text content here...
"""
structured_data = scrapegraph_tool.scrapegraph_local_scrape(
text=text, api_key="your-api-key"
)
Requirements
- Python 3.8+
scrapegraph-pypackage- Valid Scrapegraph API key
Metadata
Release files for llama-index-tools-scrapegraphai 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_index_tools_scrapegraphai-0.2.2.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_tools_scrapegraphai-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / llama_index_tools_scrapegraphai-0.2.2.tar.gz
| Download URL | llama_index_tools_scrapegraphai-0.2.2.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4465b6d338f388ba41ee037039478ec43017ea81833ade724f7f81e5170714dd
|
|
BLAKE2b-256 checksum How to use checksums |
3d560e90c2bbe3033429352a6a2793aabbdcaaf49f76dfc22fde4c3f7442cadb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Release files / llama_index_tools_scrapegraphai-0.2.2-py3-none-any.whl
| Download URL | llama_index_tools_scrapegraphai-0.2.2-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1317a189b47862b51eeeaf7b6e06e342b801c6c245d6b3217c0f26e8ee5b456f
|
|
BLAKE2b-256 checksum How to use checksums |
3ccf9516c129ec24f3e928cc32afe50f1e0ca909f340b024513656b4988b9486
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|