Skip to content

Python scraper based on AI

Update script_generator_openai.py

Marco Vinciguerra9eb40e1eae84
diff --git a/examples/openai/script_generator_openai.py b/examples/openai/script_generator_openai.py
index 119f67e5..13b40530 100644
--- a/examples/openai/script_generator_openai.py
+++ b/examples/openai/script_generator_openai.py
@@ -5,7 +5,7 @@ Basic example of scraping pipeline using SmartScraper
import os
import json
from dotenv import load_dotenv
-from scrapegraphai.graphs import SmartScraperGraph
+from scrapegraphai.graphs import ScriptCreatorGraph
from scrapegraphai.utils import prettify_exec_info
load_dotenv()
@@ -28,9 +28,10 @@ graph_config = {
# Create the SmartScraperGraph instance and run it
# ************************************************
-smart_scraper_graph = SmartScraperGraph(
- prompt="List me what does the company do, the name and a contact email.",
- source="https://scrapegraphai.com/",
+smart_scraper_graph = ScriptCreatorGraph(
+ prompt="List me all the news with their description.",
+ # also accepts a string with the already downloaded HTML code
+ source="https://perinim.github.io/projects",
config=graph_config
)