v1.43.1
Whats Changed
You can now get the final redirect destination from pages with page.get_url_final
. If you need to see if a redirect was performed you can access page.final_redirect_destination
to get the Option.
- feat(page): add page redirect destination exposure #127
Example:
use spider::tokio;
use spider::website::Website;
#[tokio::main]
async fn main() {
let mut website: Website = Website::new("https://rsseau.fr");
let mut rx2 = website.subscribe(16).unwrap();
tokio::spawn(async move {
while let Ok(res) = rx2.recv().await {
// return final redirect if found or the url used for the request
println!("{:?}", res.get_url_final());
}
});
website.crawl().await;
}
Thank you @matteoredaelli @joksas for the issue and help!
Full Changelog: v1.42.1...v1.43.1