[−][src]Struct soup::Soup
Parses HTML & provides methods to query & manipulate the document
Methods
impl Soup
[src]
pub fn new(html: &str) -> Soup
[src]
Create a new Soup
instance from a string slice
Example
let html = r#" <!doctype html> <html> <head> <title>page title</title> </head> <body> <h1>Heading</h1> <p>Some text</p> <p>Some more text</p> </body> </html> "#; let soup = Soup::new(html);
pub fn from_reader<R: Read>(reader: R) -> Result<Soup>
[src]
Create a new Soup
instance from something that implements Read
This is good for parsing the output of an HTTP response, for example.
use soup::prelude::*; let response = reqwest::get("https://docs.rs/soup")?; let soup = Soup::from_reader(response)?;
pub fn text(&self) -> String
[src]
Extracts all text from the HTML
Trait Implementations
impl Debug for Soup
[src]
impl From<RcDom> for Soup
[src]
impl QueryBuilderExt for Soup
[src]
fn get_handle(&self) -> Handle
[src]
fn limit<'a>(&self, limit: usize) -> QueryBuilder<'a, (), ()>
[src]
fn tag<'a, P: Pattern>(
&self,
tag: P
) -> QueryBuilder<'a, TagQuery<P>, QueryWrapper<'a, (), ()>>
[src]
&self,
tag: P
) -> QueryBuilder<'a, TagQuery<P>, QueryWrapper<'a, (), ()>>
fn attr_name<'a, P>(
&self,
name: P
) -> QueryBuilder<'a, AttrQuery<P, bool>, QueryWrapper<'a, (), ()>> where
P: Pattern,
[src]
&self,
name: P
) -> QueryBuilder<'a, AttrQuery<P, bool>, QueryWrapper<'a, (), ()>> where
P: Pattern,
fn attr_value<'a, P>(
&self,
value: P
) -> QueryBuilder<'a, AttrQuery<bool, P>, QueryWrapper<'a, (), ()>> where
P: Pattern,
[src]
&self,
value: P
) -> QueryBuilder<'a, AttrQuery<bool, P>, QueryWrapper<'a, (), ()>> where
P: Pattern,
fn attr<'a, P, Q>(
&self,
name: P,
value: Q
) -> QueryBuilder<'a, AttrQuery<P, Q>, QueryWrapper<'a, (), ()>> where
P: Pattern,
Q: Pattern,
[src]
&self,
name: P,
value: Q
) -> QueryBuilder<'a, AttrQuery<P, Q>, QueryWrapper<'a, (), ()>> where
P: Pattern,
Q: Pattern,
fn class<'a, P: Pattern>(
&self,
value: P
) -> QueryBuilder<'a, AttrQuery<&'static str, P>, QueryWrapper<'a, (), ()>>
[src]
&self,
value: P
) -> QueryBuilder<'a, AttrQuery<&'static str, P>, QueryWrapper<'a, (), ()>>
fn recursive<'a>(&self, recursive: bool) -> QueryBuilder<'a, (), ()>
[src]
fn children(&self) -> NodeChildIter
[src]
fn parents(&self) -> NodeParentIter
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Soup
impl !Send for Soup
impl !Sync for Soup
impl Unpin for Soup
impl !UnwindSafe for Soup
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,