diff --git a/scraping_scrapegraph_gemini.py b/scraping_scrapegraph_gemini.py new file mode 100644 index 0000000..be01777 --- /dev/null +++ b/scraping_scrapegraph_gemini.py @@ -0,0 +1,20 @@ +from scrapegraphai.graphs import SmartScraperGraph +GOOGLE_APIKEY = "YOUR_API_KEY" + +# Define the configuration for the graph +graph_config = { + "llm": { + "api_key": GOOGLE_APIKEY, + "model": "gemini-pro", + }, +} + +# Create the SmartScraperGraph instance +smart_scraper_graph = SmartScraperGraph( + prompt="List me all the quotes, authors and tags ", + file_source="http://quotes.toscrape.com", # also accepts a string with the already downloaded HTML code as string format + config=graph_config +) + +result = smart_scraper_graph.run() +print(result) \ No newline at end of file diff --git a/scraping_scrapegraph_openai.py b/scraping_scrapegraph_openai.py new file mode 100644 index 0000000..d42145a --- /dev/null +++ b/scraping_scrapegraph_openai.py @@ -0,0 +1,20 @@ +from scrapegraphai.graphs import SmartScraperGraph +OPENAI_API_KEY = "YOUR_API_KEY" + +# Define the configuration for the graph +graph_config = { + "llm": { + "api_key": OPENAI_API_KEY, + "model": "gpt-3.5-turbo", + }, +} + +# Create the SmartScraperGraph instance +smart_scraper_graph = SmartScraperGraph( + prompt="List me all the quotes, authors and tags ", + file_source="http://quotes.toscrape.com", # also accepts a string with the already downloaded HTML code as string format + config=graph_config +) + +result = smart_scraper_graph.run() +print(result) \ No newline at end of file