Python scraper based on AI
Python ai-crawlerai-scrapingai-searchcrawlerdata-extractionfirecrawl-alternativelarge-language-modelllmmarkdownragscrapingscraping-pythonweb-crawlerweb-crawlersweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
Fixes node expression validator error message to make it easier to debug missing keys
elijahbenizzy25d8fd2e7270
diff --git a/scrapegraphai/nodes/base_node.py b/scrapegraphai/nodes/base_node.pyindex aa7d2853..206b0547 100644--- a/scrapegraphai/nodes/base_node.py+++ b/scrapegraphai/nodes/base_node.py@@ -113,7 +113,7 @@ class BaseNode(ABC):self._validate_input_keys(input_keys)return input_keysexcept ValueError as e:- raise ValueError(f"Error parsing input keys for {self.node_name}: {str(e)}")+ raise ValueError(f"Error parsing input keys for {self.node_name}") from edef _validate_input_keys(self, input_keys):"""@@ -233,7 +233,7 @@ class BaseNode(ABC):result = evaluate_expression(expression)if not result:- raise ValueError("No state keys matched the expression.")+ raise ValueError(f"No state keys matched the expression. Expression was {expression}. State contains keys: {', '.join(state.keys())}")# Remove redundant state keys from the result, without changing their orderfinal_result = []