mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-23 21:00:30 +08:00
23 lines
563 B
Python
23 lines
563 B
Python
"""
|
|
Basic example of scraping pipeline using SmartScraper
|
|
"""
|
|
|
|
import os
|
|
from dotenv import load_dotenv
|
|
from scrapegraphai.graphs import SmartScraperGraph
|
|
|
|
load_dotenv()
|
|
|
|
# Define the configuration for the language model
|
|
openai_key = os.getenv("OPENAI_APIKEY")
|
|
llm_config = {
|
|
"api_key": openai_key,
|
|
"model_name": "gpt-3.5-turbo",
|
|
}
|
|
|
|
smart_scraper_graph = SmartScraperGraph("List me all the titles and project descriptions",
|
|
"https://perinim.github.io/projects/", llm_config)
|
|
|
|
answer = smart_scraper_graph.run()
|
|
print(answer)
|