Class SeleniumDocumentLoader
java.lang.Object
dev.langchain4j.data.document.loader.selenium.SeleniumDocumentLoader
- All Implemented Interfaces:
AutoCloseable
Utility class for loading web documents using Selenium.
Returns a
Document object containing the content of the Web page.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voidclose()Closes the underlying WebDriver instance.dev.langchain4j.data.document.DocumentLoads a document from the specified URL.pageReadyCondition(org.openqa.selenium.support.ui.ExpectedCondition<Boolean> condition) Set a custom page ready condition for waiting until the page is loaded.
-
Method Details
-
pageReadyCondition
public SeleniumDocumentLoader pageReadyCondition(org.openqa.selenium.support.ui.ExpectedCondition<Boolean> condition) Set a custom page ready condition for waiting until the page is loaded.- Parameters:
condition- the ExpectedCondition to use- Returns:
- this loader instance
-
load
public dev.langchain4j.data.document.Document load(String url, dev.langchain4j.data.document.DocumentParser documentParser) Loads a document from the specified URL.- Parameters:
url- The URL of the file. Must not be null.documentParser- The parser to be used for parsing text from the URL. Must not be null.- Returns:
- document
-
close
public void close()Closes the underlying WebDriver instance.- Specified by:
closein interfaceAutoCloseable
-
builder
-