Skip to main content

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:

  1. 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
)
  1. Markdownify

Convert webpage content to markdown format:

markdown_content = scrapegraph_tool.scrapegraph_markdownify(
    url="https://example.com", api_key="your-api-key"
)
  1. 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-py package
  • 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)

Source distribution for llama-index-tools-scrapegraphai 0.2.2
File Size Uploaded
llama_index_tools_scrapegraphai-0.2.2.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-tools-scrapegraphai 0.2.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page