# 创建 SmartScraperGraph 实例 smart_scraper_graph = SmartScraperGraph( prompt="List me all the projects with their descriptions", source="https://perinim.github.io/projects", # 数据来源 config=graph_config )
# 运行并输出结果 result = smart_scraper_graph.run() print(result)
输出示例:
1 2 3 4 5 6 7 8 9 10 11 12 13
{ "projects":[ { "title":"Rotary Pendulum RL", "description":"Open Source project aimed at controlling a real-life rotary pendulum using RL algorithms" }, { "title":"DQN Implementation from scratch", "description":"Developed a Deep Q-Network algorithm to train a simple and double pendulum" }, ... ] }
# 创建 SearchGraph 实例 search_graph = SearchGraph( prompt="List me all the traditional recipes from Chioggia", config=graph_config )
# 运行并输出结果 result = search_graph.run() print(result)
输出示例:
1 2 3 4 5 6 7 8 9
{ "recipes":[ {"name":"Sarde in Saòre"}, {"name":"Bigoli in salsa"}, {"name":"Seppie in umido"}, {"name":"Moleche frite"}, {"name":"Risotto alla pescatora"} ] }