@@ -44,7 +44,7 @@ print(markdown)
4444Extract structured data from any webpage using natural language prompts.
4545
4646``` python
47- from langchain_scrapegraph.tools import SmartscraperTool
47+ from langchain_scrapegraph.tools import SmartScraperTool
4848
4949# Initialize the tool (uses SGAI_API_KEY from environment)
5050tool = SmartscraperTool()
@@ -66,15 +66,15 @@ You can define the structure of the output using Pydantic models:
6666``` python
6767from typing import List
6868from pydantic import BaseModel, Field
69- from langchain_scrapegraph.tools import SmartscraperTool
69+ from langchain_scrapegraph.tools import SmartScraperTool
7070
7171class WebsiteInfo (BaseModel ):
7272 title: str = Field(description = " The main title of the webpage" )
7373 description: str = Field(description = " The main description or first paragraph" )
7474 urls: List[str ] = Field(description = " The URLs inside the webpage" )
7575
7676# Initialize with schema
77- tool = SmartscraperTool (llm_output_schema = WebsiteInfo)
77+ tool = SmartScraperTool (llm_output_schema = WebsiteInfo)
7878
7979# The output will conform to the WebsiteInfo schema
8080result = tool.invoke({
@@ -95,9 +95,9 @@ print(result)
9595Extract information from HTML content using AI.
9696
9797``` python
98- from langchain_scrapegraph.tools import LocalscraperTool
98+ from langchain_scrapegraph.tools import LocalScraperTool
9999
100- tool = LocalscraperTool ()
100+ tool = LocalScraperTool ()
101101result = tool.invoke({
102102 " user_prompt" : " Extract all contact information" ,
103103 " website_html" : " <html>...</html>"
@@ -114,7 +114,7 @@ You can define the structure of the output using Pydantic models:
114114``` python
115115from typing import Optional
116116from pydantic import BaseModel, Field
117- from langchain_scrapegraph.tools import LocalscraperTool
117+ from langchain_scrapegraph.tools import LocalScraperTool
118118
119119class CompanyInfo (BaseModel ):
120120 name: str = Field(description = " The company name" )
@@ -123,7 +123,7 @@ class CompanyInfo(BaseModel):
123123 phone: Optional[str ] = Field(description = " Contact phone if available" )
124124
125125# Initialize with schema
126- tool = LocalscraperTool (llm_output_schema = CompanyInfo)
126+ tool = LocalScraperTool (llm_output_schema = CompanyInfo)
127127
128128html_content = """
129129<html>
@@ -173,12 +173,12 @@ print(result)
173173
174174``` python
175175from langchain.agents import initialize_agent, AgentType
176- from langchain_scrapegraph.tools import SmartscraperTool
176+ from langchain_scrapegraph.tools import SmartScraperTool
177177from langchain_openai import ChatOpenAI
178178
179179# Initialize tools
180180tools = [
181- SmartscraperTool (),
181+ SmartScraperTool (),
182182]
183183
184184# Create an agent
0 commit comments