-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #754 from ekinsenler/cond_node_refactor
feat: add conditional node to the smart_scraper_graph
- Loading branch information
Showing
8 changed files
with
137 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
Basic example of scraping pipeline using SmartScraperMultiConcatGraph with Groq | ||
""" | ||
|
||
import os | ||
import json | ||
from dotenv import load_dotenv | ||
from scrapegraphai.graphs import SmartScraperGraph | ||
|
||
load_dotenv() | ||
|
||
# ************************************************ | ||
# Define the configuration for the graph | ||
# ************************************************ | ||
|
||
graph_config = { | ||
"llm": { | ||
"api_key": os.getenv("GROQ_APIKEY"), | ||
"model": "groq/gemma-7b-it", | ||
}, | ||
"verbose": True, | ||
"headless": True, | ||
"reattempt": True #Setting this to True will allow the graph to reattempt the scraping process | ||
} | ||
|
||
# ******************************************************* | ||
# Create the SmartScraperMultiCondGraph instance and run it | ||
# ******************************************************* | ||
|
||
multiple_search_graph = SmartScraperGraph( | ||
prompt="Who is Marco Perini?", | ||
source="https://perinim.github.io/", | ||
schema=None, | ||
config=graph_config | ||
) | ||
|
||
result = multiple_search_graph.run() | ||
print(json.dumps(result, indent=4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters