• LangChain
  • 核心
  • 社区
  • 实验性
  • 文本分割器
  • ai21
  • airbyte
  • anthropic
  • astradb
  • aws
  • azure-dynamic-sessions
  • chroma
  • cohere
  • couchbase
  • elasticsearch
  • exa
  • fireworks
  • google-community
  • google-genai
  • google-vertexai
  • groq
  • huggingface
  • ibm
  • milvus
  • mistralai
  • mongodb
  • nomic
  • nvidia-ai-endpoints
  • ollama
  • openai
  • pinecone
  • postgres
  • prompty
  • qdrant
  • robocorp
  • together
  • unstructured
  • voyageai
  • weaviate
  • 合作伙伴库
    ai21 airbyte anthropic astradb aws azure-dynamic-sessions chroma cohere couchbase elasticsearch exa fireworks google-community google-genai google-vertexai groq huggingface ibm milvus mistralai mongodb nomic nvidia-ai-endpoints ollama openai pinecone postgres prompty qdrant robocorp together unstructured voyageai weaviate
  • 文档
  • langchain_core.utils.html.extract_sub_links
    • extract_sub_links()

langchain_core.utils.html.extract_sub_links¶

langchain_core.utils.html.extract_sub_links(raw_html: str, url: str, *, base_url: Optional[str] = None, pattern: Optional[Union[str, Pattern]] = None, prevent_outside: bool = True, exclude_prefixes: Sequence[str] = (), continue_on_failure: bool = False) → List[str][source]¶

从原始HTML字符串中提取所有链接并将其转换为绝对路径。

参数
  • raw_html (str) – 原始HTML。

  • url (str) – HTML的URL。

  • base_url (Optional[str]) – 用于检查外部链接的基本URL。

  • pattern (Optional[Union[str, Pattern]]) – 用于从原始HTML中提取链接的正则表达式。

  • prevent_outside (bool) – 如果为True,忽略不是基本URL子链接的外部链接。

  • exclude_prefixes (Sequence[str]) – 排除以这些前缀之一开始的任何URL。

  • continue_on_failure (bool) – 如果为True,解析特定链接引发异常时继续。否则,抛出异常。

返回

子链接。

返回类型

List[str]

© 2023, LangChain, Inc. . 最后更新于2024年8月6日。