langchain_community.document_loaders.url_selenium.SeleniumURLLoader

class langchain_community.document_loaders.url_selenium.SeleniumURLLoader(urls: List[str], continue_on_failure: bool = True, browser: Literal['chrome', 'firefox'] = 'chrome', binary_location: Optional[str] = None, executable_path: Optional[str] = None, headless: bool = True, arguments: List[str] = [])[source]

使用`Selenium`加载`HTML`页面,并使用`Unstructured`进行解析。

这对于加载需要JavaScript渲染的页面非常有用。

属性:

urls (List[str]): 要加载的URL列表。 continue_on_failure (bool): 如果为True,则在失败时继续加载其他URL。 browser (str): 要使用的浏览器,可以是’chrome’或’firefox’。 binary_location (Optional[str]): 浏览器二进制文件的位置。 executable_path (Optional[str]): 浏览器可执行文件的路径。 headless (bool): 如果为True,则浏览器将以无头模式运行。 arguments [List[str]]: 要传递给浏览器的参数列表。

使用Selenium和非结构化方式加载URL列表。

Methods

__init__(urls[, continue_on_failure, ...])

使用Selenium和非结构化方式加载URL列表。

alazy_load()

一个用于文档的惰性加载器。

aload()

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

lazy_load()

一个用于文档的惰性加载器。

load()

使用Selenium加载指定的URL,并创建Document实例。

load_and_split([text_splitter])

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

Parameters
  • urls (List[str]) –

  • continue_on_failure (bool) –

  • browser (Literal['chrome', 'firefox']) –

  • binary_location (Optional[str]) –

  • executable_path (Optional[str]) –

  • headless (bool) –

  • arguments (List[str]) –

__init__(urls: List[str], continue_on_failure: bool = True, browser: Literal['chrome', 'firefox'] = 'chrome', binary_location: Optional[str] = None, executable_path: Optional[str] = None, headless: bool = True, arguments: List[str] = [])[source]

使用Selenium和非结构化方式加载URL列表。

Parameters
  • urls (List[str]) –

  • continue_on_failure (bool) –

  • browser (Literal['chrome', 'firefox']) –

  • binary_location (Optional[str]) –

  • executable_path (Optional[str]) –

  • headless (bool) –

  • arguments (List[str]) –

async alazy_load() AsyncIterator[Document]

一个用于文档的惰性加载器。

Return type

AsyncIterator[Document]

async aload() List[Document]

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

Return type

List[Document]

lazy_load() Iterator[Document]

一个用于文档的惰性加载器。

Return type

Iterator[Document]

load() List[Document][source]

使用Selenium加载指定的URL,并创建Document实例。

返回:

List[Document]: 加载内容的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 SeleniumURLLoader