make it global
This commit is contained in:
parent
d646d23895
commit
820e7e5885
13
src/main.rs
13
src/main.rs
@ -2,7 +2,7 @@ use scraper::{Html, Selector};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let url_base = "https://www.eyca.org/discounts/gb/";
|
||||
let url_base = "https://www.eyca.org/discounts/";
|
||||
|
||||
let response = reqwest::get(url_base.to_string() + &1.to_string()).await.unwrap();
|
||||
|
||||
@ -66,11 +66,14 @@ fn print_discounts(document: &Html) {
|
||||
println!("tags: None");
|
||||
}
|
||||
|
||||
//get category and locations
|
||||
//get other info
|
||||
let selector = Selector::parse("div.card-content.p1.sd-p2 > ul > li").unwrap();
|
||||
let mut category_and_locations = article.select(&selector);
|
||||
println!("category: {}", category_and_locations.next().unwrap().text().next().unwrap());
|
||||
println!("locations: {}", category_and_locations.next().unwrap().text().next().unwrap().trim());
|
||||
let other_info = article.select(&selector);
|
||||
println!("other info:");
|
||||
for x in other_info {
|
||||
let text = x.text().next().unwrap().trim();
|
||||
println!("{}", text);
|
||||
}
|
||||
|
||||
//print separator
|
||||
println!("-----------------------------------------------------");
|
||||
|
Loading…
x
Reference in New Issue
Block a user