Skip to content

Commit 52b6bf5

Browse files
committed
feat: refactoring of ScrapeGraph to SmartScraperLiteGraph
1 parent b84883b commit 52b6bf5

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

scrapegraphai/graphs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
from .code_generator_graph import CodeGeneratorGraph
2727
from .depth_search_graph import DepthSearchGraph
2828
from .smart_scraper_multi_lite_graph import SmartScraperMultiLiteGraph
29-
from .scrape_graph import ScrapeGraph
29+
from .smart_scraper_lite_graph import SmartScraperLiteGraph

scrapegraphai/graphs/scrape_graph.py renamed to scrapegraphai/graphs/smart_scraper_lite_graph.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
ParseNode,
1111
)
1212

13-
class ScrapeGraph(AbstractGraph):
13+
class SmartScraperLiteGraph(AbstractGraph):
1414
"""
15-
ScrapeGraph is a scraping pipeline that automates the process of
15+
SmartScraperLiteGraph is a scraping pipeline that automates the process of
1616
extracting information from web pages.
1717
1818
Attributes:
@@ -30,15 +30,16 @@ class ScrapeGraph(AbstractGraph):
3030
schema (BaseModel): The schema for the graph output.
3131
3232
Example:
33-
>>> scraper = ScraperGraph(
33+
>>> scraper = SmartScraperLiteGraph(
3434
... "https://en.wikipedia.org/wiki/Chioggia",
3535
... {"llm": {"model": "openai/gpt-3.5-turbo"}}
3636
... )
3737
>>> result = smart_scraper.run()
3838
)
3939
"""
4040

41-
def __init__(self, source: str, config: dict, prompt: str = "", schema: Optional[BaseModel] = None):
41+
def __init__(self, source: str, config: dict, prompt: str = "",
42+
schema: Optional[BaseModel] = None):
4243
super().__init__(prompt, config, source, schema)
4344

4445
self.input_key = "url" if source.startswith("http") else "local_dir"

scrapegraphai/graphs/smart_scraper_multi_lite_graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pydantic import BaseModel
77
from .base_graph import BaseGraph
88
from .abstract_graph import AbstractGraph
9-
from .scrape_graph import ScrapeGraph
9+
from .smart_scraper_lite_graph import SmartScraperLiteGraph
1010
from ..nodes import (
1111
GraphIteratorNode,
1212
MergeAnswersNode,
@@ -63,7 +63,7 @@ def _create_graph(self) -> BaseGraph:
6363
input="user_prompt & urls",
6464
output=["parsed_doc"],
6565
node_config={
66-
"graph_instance": ScrapeGraph,
66+
"graph_instance": SmartScraperLiteGraph,
6767
"scraper_config": self.copy_config,
6868
},
6969
schema=self.copy_schema

0 commit comments

Comments
 (0)