mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-12 21:01:56 +08:00
feat: refactoring fetch_node
This commit is contained in:
parent
12f2b9946b
commit
39a029ed9a
@ -124,7 +124,7 @@ class FetchNode(BaseNode):
|
|||||||
return handlers[input_type](state, input_type, source)
|
return handlers[input_type](state, input_type, source)
|
||||||
elif self.input == "pdf_dir":
|
elif self.input == "pdf_dir":
|
||||||
return state
|
return state
|
||||||
elif not source.startswith("http"):
|
elif not source.startswith("http") or not source.startswith("www"):
|
||||||
return self.handle_local_source(state, source)
|
return self.handle_local_source(state, source)
|
||||||
else:
|
else:
|
||||||
return self.handle_web_source(state, source)
|
return self.handle_web_source(state, source)
|
||||||
@ -307,6 +307,7 @@ class FetchNode(BaseNode):
|
|||||||
if not document or not document[0].page_content.strip():
|
if not document or not document[0].page_content.strip():
|
||||||
raise ValueError("""No HTML body content found in
|
raise ValueError("""No HTML body content found in
|
||||||
the document fetched by ChromiumLoader.""")
|
the document fetched by ChromiumLoader.""")
|
||||||
|
|
||||||
parsed_content = document[0].page_content
|
parsed_content = document[0].page_content
|
||||||
|
|
||||||
if (isinstance(self.llm_model, ChatOpenAI) \
|
if (isinstance(self.llm_model, ChatOpenAI) \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user