make it global

This commit is contained in:
winneratwin 2022-06-08 07:23:44 +01:00
parent d646d23895
commit 820e7e5885
Signed by: winneratwin
GPG Key ID: CDBC42F8803D689E
2 changed files with 328447 additions and 665 deletions

329099
deals.txt

File diff suppressed because it is too large Load Diff

View File

@ -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!("-----------------------------------------------------");