Skip to content

Commit abf39b5

Browse files
authored
Merge pull request #847 from gsavvid/main
fix: validate URL only if the input type is a URL
2 parents 67038e1 + e2caee6 commit abf39b5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

scrapegraphai/nodes/fetch_node.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ def execute(self, state):
131131
return state
132132

133133
# For web sources, validate URL before proceeding
134-
try:
135-
if self.is_valid_url(source):
136-
return self.handle_web_source(state, source)
137-
except ValueError as e:
138-
# Re-raise the exception from is_valid_url
139-
raise
134+
if input_type == "url":
135+
try:
136+
if self.is_valid_url(source):
137+
return self.handle_web_source(state, source)
138+
except ValueError as e:
139+
# Re-raise the exception from is_valid_url
140+
raise
140141

141142
return self.handle_local_source(state, source)
142143

0 commit comments

Comments
 (0)