Skip to content

Python scraper based on AI

fix: conditional node

Marco Vinciguerra778efd4c87c6
diff --git a/scrapegraphai/nodes/conditional_node.py b/scrapegraphai/nodes/conditional_node.py
index cee91156..6a1aad4e 100644
--- a/scrapegraphai/nodes/conditional_node.py
+++ b/scrapegraphai/nodes/conditional_node.py
@@ -1,4 +1,4 @@
-"""
+"""
Module for implementing the conditional node
"""
from typing import Optional, List
@@ -28,21 +28,11 @@ class ConditionalNode(BaseNode):
"""
- def __init__(self,
- input: str,
- output: List[str],
- node_config: Optional[dict] = None,
- node_name: str = "GenerateAnswerCSV",
- ):
+ def __init__(self):
"""
- Initializes the node with the key to check and the next node names based on the condition.
-
- Args:
- key_name (str): The name of the key to check in the state.
+ Initializes an empty ConditionalNode.
"""
-
- #super().__init__(node_name, "node", input, output, 2, node_config)
-
+ pass
def execute(self, state: dict) -> dict:
"""
@@ -55,8 +45,4 @@ class ConditionalNode(BaseNode):
str: The name of the next node to execute based on the presence of the key.
"""
- if self.key_name in state and len(state[self.key_name]) > 0:
- state["next_node"] = 0
- else:
- state["next_node"] = 1
- return state
+ pass