Scrapegraph-ai/examples/openai/fetch_multiple_links.py
2024-10-02 11:01:23 +02:00

22 lines
469 B
Python

from scrapegraphai.graphs import DepthSearchGraph
graph_config = {
"llm": {
"api_key":"YOUR_API_KEY",
"model": "openai/gpt-4o-mini",
},
"verbose": True,
"headless": False,
"depth": 2,
"only_inside_links": True,
}
search_graph = DepthSearchGraph(
prompt="List me all the projects with their description",
source="https://perinim.github.io/projects/",
config=graph_config
)
result = search_graph.run()
print(result)