pub struct AdaptiveDocument { /* private fields */ }Expand description
A parsed HTML document with adaptive-relocation support.
Implementations§
Source§impl AdaptiveDocument
impl AdaptiveDocument
pub fn parse(html: &str) -> Self
Sourcepub fn css(&self, selector: &str) -> Result<Vec<AdaptiveElement<'_>>, Error>
pub fn css(&self, selector: &str) -> Result<Vec<AdaptiveElement<'_>>, Error>
All elements matching a CSS selector.
Sourcepub fn css_first(
&self,
selector: &str,
) -> Result<Option<AdaptiveElement<'_>>, Error>
pub fn css_first( &self, selector: &str, ) -> Result<Option<AdaptiveElement<'_>>, Error>
First element matching a CSS selector.
Sourcepub fn relocate(
&self,
fingerprint: &ElementFingerprint,
threshold: SimilarityThreshold,
) -> Vec<AdaptiveElement<'_>>
pub fn relocate( &self, fingerprint: &ElementFingerprint, threshold: SimilarityThreshold, ) -> Vec<AdaptiveElement<'_>>
Find the elements most similar to fingerprint, accepting anything at
or above threshold. Returns the best-scoring group (there may be
ties), highest first; empty when nothing clears the bar.
Auto Trait Implementations§
impl !RefUnwindSafe for AdaptiveDocument
impl !Send for AdaptiveDocument
impl !Sync for AdaptiveDocument
impl Freeze for AdaptiveDocument
impl Unpin for AdaptiveDocument
impl UnsafeUnpin for AdaptiveDocument
impl UnwindSafe for AdaptiveDocument
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