-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new integration for scrapegraphai
- Loading branch information
1 parent
76b9a3b
commit 6b3db6c
Showing
4 changed files
with
71 additions
and
18 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,2 @@ | ||
|
||
__pycache__/task.cpython-311.pyc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
scrapegraphai==0.0.4 | ||
streamlit==1.26.0 |
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,19 @@ | ||
from scrapegraphai.graphs import SmartScraperGraph | ||
|
||
def task(key:str, url:str, prompt:str, model:str): | ||
""" | ||
Task that execute the scraping: | ||
- key (str): key of the model | ||
- url (str): url to scrape | ||
- prompt (str): prompt | ||
- model (str): name of the model | ||
""" | ||
openai_key = key | ||
llm_config = { | ||
"api_key": openai_key, | ||
"model_name": model, | ||
} | ||
|
||
smart_scraper_graph = SmartScraperGraph(prompt, url, llm_config) | ||
|
||
return smart_scraper_graph.run() |