pub struct WebScraperLoader { /* private fields */ }Expand description
Web page scraper loader
Crawls web pages from a URL, extracting the body text. Optionally follows same-domain links recursively.
Implementations§
Source§impl WebScraperLoader
impl WebScraperLoader
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Creates a loader from a URL (crawls only the given page)
Sourcepub fn with_max_depth(self, depth: usize) -> Self
pub fn with_max_depth(self, depth: usize) -> Self
Sets the maximum recursion depth
Sourcepub fn with_max_pages(self, pages: usize) -> Self
pub fn with_max_pages(self, pages: usize) -> Self
Sets the maximum number of pages to crawl
Sourcepub fn with_fail_on_error(self, fail: bool) -> Self
pub fn with_fail_on_error(self, fail: bool) -> Self
Sets whether to return an error on crawl failure (default: skip failed pages)
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the per-HTTP-request timeout (H8, default 30s)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebScraperLoader
impl RefUnwindSafe for WebScraperLoader
impl Send for WebScraperLoader
impl Sync for WebScraperLoader
impl Unpin for WebScraperLoader
impl UnsafeUnpin for WebScraperLoader
impl UnwindSafe for WebScraperLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more