From 024674eef348e53ce7c54a4153d5bd852f00b350 Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 13 Oct 2023 11:42:42 +0400 Subject: [PATCH] List check --- application/parser/remote/sitemap_loader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/parser/remote/sitemap_loader.py b/application/parser/remote/sitemap_loader.py index a8700555..e2339ab7 100644 --- a/application/parser/remote/sitemap_loader.py +++ b/application/parser/remote/sitemap_loader.py @@ -10,6 +10,10 @@ class SitemapLoader(BaseRemote): self.limit = limit # Adding limit to control the number of URLs to process def load_data(self, sitemap_url): + # Check if the input is a list and if it is, use the first element + if isinstance(sitemap_url, list) and sitemap_url: + url = sitemap_url[0] + urls = self._extract_urls(sitemap_url) if not urls: print(f"No URLs found in the sitemap: {sitemap_url}")