};
let selector = Selector::parse("div.productGridElement > h2 > a:nth-child(1)").unwrap();
+ let url = format!("https://www.steg-electronics.ch/fr/search?suche={}", to_find);
+
+ let client = reqwest::blocking::Client::new();
loop {
- let url = format!("https://www.steg-electronics.ch/fr/search?suche={}", to_find);
println!("Request: {}", url);
- let resp = reqwest::blocking::get(&url)?;
+ let resp = client.get(&url).send()?;
if resp.status().is_success() {
let html = resp.text()?;