Skip to content

Commit 4bc9343

Browse files
committed
Fix get_links logic
1 parent 02b4bb2 commit 4bc9343

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llmstack/data/apis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ def extract_urls(self, request):
502502
runner_url = f"{settings.RUNNER_HOST}:{settings.RUNNER_PORT}"
503503
urls = [url]
504504

505-
with WebBrowser(runner_url, html=True, interactive=False) as browser:
506-
urls.extend(browser.get_links(url=url))
505+
with WebBrowser(runner_url, html=True, interactive=False, tags_to_extract=["a"]) as browser:
506+
urls.extend([entry.url for entry in browser.get_links(url=url)])
507507

508+
urls = list(set(filter(lambda x: x.startswith("http"), urls)))
508509
return DRFResponse({"urls": urls})

0 commit comments

Comments
 (0)