I need to download html code from some web page. What is the best way to approach this task? As I understand there are very few working web frameworks for Rust right now and hyper is the one most people use? But after searching it's documentation I couldn't find a way. The closest I got is this
extern crate hyper;
use hyper::Client;
fn main() {
let client = Client::new();
let res = client.get("http://ift.tt/mQLMLn")
.send()
.unwrap();
println!("{:?}", res);
}
But it returns Response, which doesn't seem to contain any code from html body.
Aucun commentaire:
Enregistrer un commentaire