Source code for langchain.document_loaders.rss
import logging
from typing import Any, Iterator, List, Optional, Sequence
from langchain.docstore.document import Document
from langchain.document_loaders.base import BaseLoader
from langchain.document_loaders.news import NewsURLLoader
logger = logging.getLogger(__name__)
[docs]class RSSFeedLoader(BaseLoader):
    """Load news articles from `RSS` feeds using `Unstructured`.
    Args:
        urls: URLs for RSS feeds to load. Each articles in the feed is loaded into its own document.
        opml: OPML file to load feed urls from. Only one of urls or opml should be provided.  The value
        can be a URL string, or OPML markup contents as byte or string.
        continue_on_failure: If True, continue loading documents even if
            loading fails for a particular URL.
        show_progress_bar: If True, use tqdm to show a loading progress bar. Requires
            tqdm to be installed, ``pip install tqdm``.
        **newsloader_kwargs: Any additional named arguments to pass to
            NewsURLLoader.
    Example:
        .. code-block:: python
            from langchain.document_loaders import RSSFeedLoader
            loader = RSSFeedLoader(
                urls=["<url-1>", "<url-2>"],
            )
            docs = loader.load()
    The loader uses feedparser to parse RSS feeds.  The feedparser library is not installed by default so you should
    install it if using this loader:
    https://pythonhosted.org/feedparser/
    If you use OPML, you should also install listparser:
    https://pythonhosted.org/listparser/
    Finally, newspaper is used to process each article:
    https://newspaper.readthedocs.io/en/latest/