No current event loop in thread 'MainThread' error while using SitemapLoader()
Labels: name: area: doc loader, name: auto:bug

### System Info

I am uing the code provided in the Chat-Langchain implementation

```python
def load_langchain_docs():
    return SitemapLoader(
        "https://python.langchain.com/sitemap.xml",
        filter_urls=["https://python.langchain.com/"],
        parsing_function=langchain_docs_extractor,
        default_parser="lxml",
        bs_kwargs={
            "parse_only": SoupStrainer(
                name=("article", "title", "html", "lang", "content")
            ),
        },
        meta_function=metadata_extractor,
    ).load()
```

When Fetcing pages complete the error comes.

```
Fetching pages: 100%|###################################################################################################################| 944/944 [04:17<00:00,  3.66it/s]
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000202B4D78CA0>
Traceback (most recent call last):
  File "C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
    self._check_closed()
  File "C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\python\Projects\Langchain\save_langchain_docs.py: │
│ 201 in <module>                                                                                  │
│                                                                                                  │
│   198 │   working_memory.save(documents=docs_transformed)                                        │
│   199                                                                                            │
│   200 if __name__ == "__main__":                                                                 │
│ ❱ 201 │   ingest_docs()                                                                          │
│   202                                                                                            │
│                                                                                                  │
│ C:\python\Projects\Langchain\save_langchain_docs.py: │
│ 182 in ingest_docs                                                                               │
│                                                                                                  │
│   179 def ingest_docs():                                                                         │
│   180 │   docs_from_documentation = load_langchain_docs()                                        │
│   181 │   logger.info(f"Loaded {len(docs_from_documentation)} docs from documentation")          │
│ ❱ 182 │   docs_from_api = load_api_docs()                                                        │
│   183 │   logger.info(f"Loaded {len(docs_from_api)} docs from API")                              │
│   184 │                                                                                          │
│   185 │   text_splitter = RecursiveCharacterTextSplitter(chunk_size=4000, chunk_overlap=200)     │
│                                                                                                  │
│ C:\python\Projects\Langchain\save_langchain_docs.py: │
│ 159 in load_api_docs                                                                             │
│                                                                                                  │
│   156                                                                                            │
│   157                                                                                            │
│   158 def load_api_docs():                                                                       │
│ ❱ 159 │   return RecursiveUrlLoader(                                                             │
│   160 │   │   url="https://api.python.langchain.com/en/latest/",                                 │
│   161 │   │   max_depth=8,                                                                       │
│   162 │   │   extractor=simple_extractor,                                                        │
│                                                                                                  │
│ C:\python\Projects\Gesture                                                                       │
│ Scrolling\keyvenv\lib\site-packages\langchain\document_loaders\recursive_url_loader.py:112 in    │
│ __init__                                                                                         │
│                                                                                                  │
│   109 │   │   self.timeout = timeout                                                             │
│   110 │   │   self.prevent_outside = prevent_outside if prevent_outside is not None else True    │
│   111 │   │   self.link_regex = link_regex                                                       │
│ ❱ 112 │   │   self._lock = asyncio.Lock() if self.use_async else None                            │
│   113 │   │   self.headers = headers                                                             │
│   114 │   │   self.check_response_status = check_response_status                                 │
│   115                                                                                            │
│                                                                                                  │
│ C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\asyncio\locks.py:81 in __init__        │
│                                                                                                  │
│    78 │   │   self._waiters = None                                                               │
│    79 │   │   self._locked = False                                                               │
│    80 │   │   if loop is None:                                                                   │
│ ❱  81 │   │   │   self._loop = events.get_event_loop()                                           │
│    82 │   │   else:                                                                              │
│    83 │   │   │   self._loop = loop                                                              │
│    84 │   │   │   warnings.warn("The loop argument is deprecated since Python 3.8, "             │
│                                                                                                  │
│ C:\Users\meetg\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py:642 in               │
│ get_event_loop                                                                                   │
│                                                                                                  │
│   639 │   │   │   self.set_event_loop(self.new_event_loop())                                     │
│   640 │   │                                                                                      │
│   641 │   │   if self._local._loop is None:                                                      │
│ ❱ 642 │   │   │   raise RuntimeError('There is no current event loop in thread %r.'              │
│   643 │   │   │   │   │   │   │      % threading.current_thread().name)                          │
│   644 │   │                                                                                      │
│   645 │   │   return self._local._loop                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
RuntimeError: There is no current event loop in thread 'MainThread'.
```


### Who can help?

@eyurtsev 

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [x] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [x] Async

### Reproduction

By executing the function `load_langchain_docs()` from the above code snippet, error will come.

### Expected behavior

All the pages should be scraped and loaded to `Document` class