kumo 0.2.1

An async web crawling framework for Rust — Scrapy for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::extract::response::Response;

impl Response {
    /// Resolve a relative URL against this response's URL.
    pub fn urljoin(&self, path: &str) -> String {
        use url::Url;
        Url::parse(&self.url)
            .and_then(|base| base.join(path))
            .map(|u| u.to_string())
            .unwrap_or_else(|_| path.to_string())
    }
}