Skip to content

Python scraper based on AI

Update smart_scraper_graph.py

supercoder-dev828bdeedcec0
diff --git a/scrapegraphai/graphs/smart_scraper_graph.py b/scrapegraphai/graphs/smart_scraper_graph.py
index ee230695..6192b437 100644
--- a/scrapegraphai/graphs/smart_scraper_graph.py
+++ b/scrapegraphai/graphs/smart_scraper_graph.py
@@ -65,8 +65,10 @@ class SmartScraperGraph(AbstractGraph):
output=["doc", "link_urls", "img_urls"],
node_config={
"loader_kwargs": self.config.get("loader_kwargs", {}),
+ "headless": self.config.get("headless", True) # Ensure headless flag is passed
}
)
+ logging.info("FetchNode configured with headless: %s", self.config.get("headless", True))
parse_node = ParseNode(
input="doc",
output=["parsed_doc"],
@@ -117,4 +119,4 @@ class SmartScraperGraph(AbstractGraph):
inputs = {"user_prompt": self.prompt, self.input_key: self.source}
self.final_state, self.execution_info = self.graph.execute(inputs)
- return self.final_state.get("answer", "No answer found.")
\ No newline at end of file
+ return self.final_state.get("answer", "No answer found.")