# NewsURLLoader

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/document_loaders/news/NewsURLLoader)

Load news articles from URLs using `Unstructured`.

## Signature

```python
NewsURLLoader(
    self,
    urls: List[str],
    text_mode: bool = True,
    nlp: bool = False,
    continue_on_failure: bool = True,
    show_progress_bar: bool = False,
    **newspaper_kwargs: Any = {},
)
```

## Description

**Example:**

.. code-block:: python

from langchain_community.document_loaders import NewsURLLoader

loader = NewsURLLoader(
    urls=["<url-1>", "<url-2>"],
)
docs = loader.load()

**Newspaper reference:**

https://newspaper.readthedocs.io/en/latest/

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `urls` | `List[str]` | Yes | URLs to load. Each is loaded into its own document. |
| `text_mode` | `bool` | No | If True, extract text from URL and use that for page content. Otherwise, extract raw HTML. (default: `True`) |
| `nlp` | `bool` | No | If True, perform NLP on the extracted contents, like providing a summary and extracting keywords. (default: `False`) |
| `continue_on_failure` | `bool` | No | If True, continue loading documents even if loading fails for a particular URL. (default: `True`) |
| `show_progress_bar` | `bool` | No | If True, use tqdm to show a loading progress bar. Requires tqdm to be installed, ``pip install tqdm``. (default: `False`) |
| `**newspaper_kwargs` | `Any` | No | Any additional named arguments to pass to newspaper.Article(). (default: `{}`) |

## Extends

- `BaseLoader`

## Constructors

```python
__init__(
    self,
    urls: List[str],
    text_mode: bool = True,
    nlp: bool = False,
    continue_on_failure: bool = True,
    show_progress_bar: bool = False,
    **newspaper_kwargs: Any = {},
) -> None
```

| Name | Type |
|------|------|
| `urls` | `List[str]` |
| `text_mode` | `bool` |
| `nlp` | `bool` |
| `continue_on_failure` | `bool` |
| `show_progress_bar` | `bool` |


## Properties

- `urls`
- `text_mode`
- `nlp`
- `continue_on_failure`
- `newspaper_kwargs`
- `show_progress_bar`

## Methods

- [`load()`](https://reference.langchain.com/python/langchain-community/document_loaders/news/NewsURLLoader/load)
- [`lazy_load()`](https://reference.langchain.com/python/langchain-community/document_loaders/news/NewsURLLoader/lazy_load)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/d5ea8358933260ad48dd31f7f8076555c7b4885a/libs/community/langchain_community/document_loaders/news.py#L13)