pub enum FieldSelector<'a> {
Text(&'a str),
Attr {
selector: &'a str,
attribute: &'a str,
},
}Expand description
Selector specification for SpiderPage::extract_fields.
Use From<&str> for the common text-content case:
ⓘ
page.extract_fields(&[
("title", "#productTitle".into()),
("image", FieldSelector::Attr { selector: "#img", attribute: "src" }),
]).await?;Variants§
Text(&'a str)
Extract textContent (trimmed) from the element matching this CSS
selector.
Attr
Extract an attribute value from the element matching the CSS selector.
Trait Implementations§
Source§impl<'a> Clone for FieldSelector<'a>
impl<'a> Clone for FieldSelector<'a>
Source§fn clone(&self) -> FieldSelector<'a>
fn clone(&self) -> FieldSelector<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for FieldSelector<'a>
impl<'a> Debug for FieldSelector<'a>
Auto Trait Implementations§
impl<'a> Freeze for FieldSelector<'a>
impl<'a> RefUnwindSafe for FieldSelector<'a>
impl<'a> Send for FieldSelector<'a>
impl<'a> Sync for FieldSelector<'a>
impl<'a> Unpin for FieldSelector<'a>
impl<'a> UnsafeUnpin for FieldSelector<'a>
impl<'a> UnwindSafe for FieldSelector<'a>
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