File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ " llm " : {
3+ " model " : " ollama/llama3" ,
4+ " temperature " : 0,
5+ " format " : " json" ,
6+ # "base_url": "http://localhost:11434",
7+ },
8+ " embeddings " : {
9+ " model " : " ollama/nomic-embed-text" ,
10+ " temperature " : 0,
11+ # "base_url": "http://localhost:11434",
12+ },
13+ " verbose " : true,
14+ " headless " : false
15+ }
Original file line number Diff line number Diff line change 1+ """
2+ Basic example of scraping pipeline using SmartScraper
3+ """
4+ import yaml
5+ from scrapegraphai .graphs import SmartScraperGraph
6+ from scrapegraphai .utils import prettify_exec_info
7+
8+ # ************************************************
9+ # Define the configuration for the graph
10+ # ************************************************
11+ with open ("example.yml" , 'r' ) as file :
12+ graph_config = yaml .safe_load (file )
13+
14+ # ************************************************
15+ # Create the SmartScraperGraph instance and run it
16+ # ************************************************
17+
18+ smart_scraper_graph = SmartScraperGraph (
19+ prompt = "List me all the titles" ,
20+ source = "https://sport.sky.it/nba?gr=www" ,
21+ config = graph_config
22+ )
23+
24+ result = smart_scraper_graph .run ()
25+ print (result )
26+
27+ # ************************************************
28+ # Get graph execution info
29+ # ************************************************
30+
31+ graph_exec_info = smart_scraper_graph .get_execution_info ()
32+ print (prettify_exec_info (graph_exec_info ))
You can’t perform that action at this time.
0 commit comments