pub struct Html { /* private fields */ }Expand description
A thin wrapper around scraper::Html to make the demos in The Rust
Programming Language substantially nicer to use.
Implementations§
Source§impl Html
impl Html
Sourcepub fn parse(source: &str) -> Html
pub fn parse(source: &str) -> Html
Parse an HTML document from a string.
This is just a thin wrapper around scraper::Html::parse_document to
keep the exported API surface simpler.
Sourcepub fn select_first<'a>(&'a self, selector: &'a str) -> Option<ElementRef<'a>>
pub fn select_first<'a>(&'a self, selector: &'a str) -> Option<ElementRef<'a>>
Get the first item in the document matching a string selector. Returns Some()
If the selector is not a valid CSS selector, panics rather than
returning a Result for convenience.
Auto Trait Implementations§
impl Freeze for Html
impl !RefUnwindSafe for Html
impl !Send for Html
impl !Sync for Html
impl Unpin for Html
impl UnwindSafe for Html
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