langchain_community.document_loaders.async_html
.AsyncHtmlLoaderΒΆ
- class langchain_community.document_loaders.async_html.AsyncHtmlLoader(web_path: Union[str, List[str]], header_template: Optional[dict] = None, verify_ssl: Optional[bool] = True, proxies: Optional[dict] = None, autoset_encoding: bool = True, encoding: Optional[str] = None, default_parser: str = 'html.parser', requests_per_second: int = 2, requests_kwargs: Optional[Dict[str, Any]] = None, raise_for_status: bool = False, ignore_load_errors: bool = False, *, preserve_order: bool = True, trust_env: bool = False)[source]ΒΆ
Load HTML asynchronously.
Initialize with a webpage path.
Methods
__init__
(web_path[,Β header_template,Β ...])Initialize with a webpage path.
Lazy load text from the url(s) in web_path.
aload
()Load data into Document objects.
fetch_all
(urls)Fetch all urls concurrently with rate limiting.
Lazy load text from the url(s) in web_path.
load
()Load data into Document objects.
load_and_split
([text_splitter])Load Documents and split into chunks.
- Parameters
web_path (Union[str, List[str]]) β
header_template (Optional[dict]) β
verify_ssl (Optional[bool]) β
proxies (Optional[dict]) β
autoset_encoding (bool) β
encoding (Optional[str]) β
default_parser (str) β
requests_per_second (int) β
requests_kwargs (Optional[Dict[str, Any]]) β
raise_for_status (bool) β
ignore_load_errors (bool) β
preserve_order (bool) β
trust_env (bool) β
- __init__(web_path: Union[str, List[str]], header_template: Optional[dict] = None, verify_ssl: Optional[bool] = True, proxies: Optional[dict] = None, autoset_encoding: bool = True, encoding: Optional[str] = None, default_parser: str = 'html.parser', requests_per_second: int = 2, requests_kwargs: Optional[Dict[str, Any]] = None, raise_for_status: bool = False, ignore_load_errors: bool = False, *, preserve_order: bool = True, trust_env: bool = False)[source]ΒΆ
Initialize with a webpage path.
- Parameters
web_path (Union[str, List[str]]) β
header_template (Optional[dict]) β
verify_ssl (Optional[bool]) β
proxies (Optional[dict]) β
autoset_encoding (bool) β
encoding (Optional[str]) β
default_parser (str) β
requests_per_second (int) β
requests_kwargs (Optional[Dict[str, Any]]) β
raise_for_status (bool) β
ignore_load_errors (bool) β
preserve_order (bool) β
trust_env (bool) β
- async alazy_load() AsyncIterator[Document] [source]ΒΆ
Lazy load text from the url(s) in web_path.
- Return type
AsyncIterator[Document]
- async fetch_all(urls: List[str]) List[str] [source]ΒΆ
Fetch all urls concurrently with rate limiting.
- Parameters
urls (List[str]) β
- Return type
List[str]
- lazy_load() Iterator[Document] [source]ΒΆ
Lazy load text from the url(s) in web_path.
- Return type
Iterator[Document]
- load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document] ΒΆ
Load Documents and split into chunks. Chunks are returned as Documents.
Do not override this method. It should be considered to be deprecated!
- Parameters
text_splitter (Optional[TextSplitter]) β TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns
List of Documents.
- Return type
List[Document]