[][src]Struct soup::Soup

pub struct Soup { /* fields omitted */ }

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.