From 5100fbb01746379395a3500eae7eeeb4870be373 Mon Sep 17 00:00:00 2001 From: saied71 Date: Mon, 11 Nov 2024 14:04:52 +0330 Subject: [PATCH] add html source support for source --- scrapegraphai/nodes/fetch_node.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scrapegraphai/nodes/fetch_node.py b/scrapegraphai/nodes/fetch_node.py index 06842ca4..55f05ab6 100644 --- a/scrapegraphai/nodes/fetch_node.py +++ b/scrapegraphai/nodes/fetch_node.py @@ -170,8 +170,9 @@ def handle_file(self, state, input_type, source): compressed_document = self.load_file_content(source, input_type) - return self.update_state(state, compressed_document) - + # return self.update_state(state, compressed_document) + state.update({self.output[0]: compressed_document}) + return state def load_file_content(self, source, input_type): """ Loads the content of a file based on its input type. @@ -230,8 +231,9 @@ def handle_local_source(self, state, source): Document(page_content=parsed_content, metadata={"source": "local_dir"}) ] - return self.update_state(state, compressed_document) - + # return self.update_state(state, compressed_document) + state.update({self.output[0]: compressed_document}) + return state def handle_web_source(self, state, source): """ Handles the web source by fetching HTML content from a URL,