Created
October 24, 2023 15:33
-
-
Save FluffyDietEngine/7ed0642ea97b6088b81fa369955528d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//[dependencies] | |
// reqwest = { version = "0.10.0-alpha.2", features = ["blocking"] } | |
// tl = "0.7.7" | |
extern crate reqwest; | |
extern crate tl; | |
use std::time::Instant; | |
// need to add return type | |
fn main() { | |
let url = "https://en.wikipedia.org/wiki/Lists_of_books"; | |
let client = reqwest::blocking::Client::new(); | |
let resp = client.get(url).send().unwrap(); | |
let body = resp.text().unwrap(); | |
let start = Instant::now(); | |
let dom = tl::parse(&body, tl::ParserOptions::default()).unwrap(); | |
let _anchors = dom.query_selector("a[href]").unwrap(); | |
// meed to return _anchors from here. I could not find the data type | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment