mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-01 21:00:48 +08:00
fix: validate URL only if the input type is a URL
This commit is contained in:
parent
67038e1952
commit
e2caee695e
@ -131,12 +131,13 @@ class FetchNode(BaseNode):
|
|||||||
return state
|
return state
|
||||||
|
|
||||||
# For web sources, validate URL before proceeding
|
# For web sources, validate URL before proceeding
|
||||||
try:
|
if input_type == "url":
|
||||||
if self.is_valid_url(source):
|
try:
|
||||||
return self.handle_web_source(state, source)
|
if self.is_valid_url(source):
|
||||||
except ValueError as e:
|
return self.handle_web_source(state, source)
|
||||||
# Re-raise the exception from is_valid_url
|
except ValueError as e:
|
||||||
raise
|
# Re-raise the exception from is_valid_url
|
||||||
|
raise
|
||||||
|
|
||||||
return self.handle_local_source(state, source)
|
return self.handle_local_source(state, source)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user