File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
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 ))
You can’t perform that action at this time.
0 commit comments