Skip to content

The agent engineering platform.

community: Strip URLs from sitemap. (#30830)

Nicky Parseghian7ecdac524078
diff --git a/libs/community/langchain_community/document_loaders/sitemap.py b/libs/community/langchain_community/document_loaders/sitemap.py
index 757a3b182c..50ecddac60 100644
--- a/libs/community/langchain_community/document_loaders/sitemap.py
+++ b/libs/community/langchain_community/document_loaders/sitemap.py
@@ -185,7 +185,7 @@ class SitemapLoader(WebBaseLoader):
els.append(
{
- tag: prop.text
+ tag: prop.text.strip()
for tag in ["loc", "lastmod", "changefreq", "priority"]
if (prop := url.find(tag))
}