Skip to content

Commit e2ca41e

Browse files
committed
add example
1 parent 54a69de commit e2ca41e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""
2+
Basic example of scraping pipeline using SmartScraper
3+
"""
4+
from scrapegraphai.graphs import SearchLinkGraph
5+
from scrapegraphai.utils import prettify_exec_info
6+
# ************************************************
7+
# Define the configuration for the graph
8+
# ************************************************
9+
10+
graph_config = {
11+
"llm": {
12+
"api_key": "s",
13+
"model": "gpt-3.5-turbo",
14+
},
15+
"verbose": True,
16+
"headless": False,
17+
}
18+
19+
# ************************************************
20+
# Create the SearchLinkGraph instance and run it
21+
# ************************************************
22+
23+
smart_scraper_graph = SearchLinkGraph(
24+
source="https://sport.sky.it/nba?gr=www",
25+
config=graph_config
26+
)
27+
28+
result = smart_scraper_graph.run()
29+
print(result)
30+
31+
# ************************************************
32+
# Get graph execution info
33+
# ************************************************
34+
35+
graph_exec_info = smart_scraper_graph.get_execution_info()
36+
print(prettify_exec_info(graph_exec_info))

0 commit comments

Comments
 (0)