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)[source]

异步加载`HTML`。

使用网页路径进行初始化。

Methods

__init__(web_path[, header_template, ...])

使用网页路径进行初始化。

alazy_load()

从web_path中的url(s)中延迟加载文本。

aload()

将数据加载到文档对象中。

fetch_all(urls)

以限制速率并发获取所有URL。

lazy_load()

从web_path中的url(s)中延迟加载文本。

load()

将数据加载到文档对象中。

load_and_split([text_splitter])

加载文档并分割成块。块作为文档返回。

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) –

__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)[source]

使用网页路径进行初始化。

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) –

async alazy_load() AsyncIterator[Document][source]

从web_path中的url(s)中延迟加载文本。

Return type

AsyncIterator[Document]

async aload() List[Document]

将数据加载到文档对象中。

Return type

List[Document]

async fetch_all(urls: List[str]) List[str][source]

以限制速率并发获取所有URL。

Parameters

urls (List[str]) –

Return type

List[str]

lazy_load() Iterator[Document][source]

从web_path中的url(s)中延迟加载文本。

Return type

Iterator[Document]

load() List[Document]

将数据加载到文档对象中。

Return type

List[Document]

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]

加载文档并分割成块。块作为文档返回。

不要覆盖此方法。应该被视为已弃用!

参数:
text_splitter: 用于分割文档的TextSplitter实例。

默认为RecursiveCharacterTextSplitter。

返回:

文档列表。

Parameters

text_splitter (Optional[TextSplitter]) –

Return type

List[Document]

Examples using AsyncHtmlLoader