From 6dc1fb616f9ef084ab5067e2fbdaa90d9f043309 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 15 Aug 2022 14:53:09 +0200 Subject: [PATCH] wip fetching dates --- src/info.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/info.rs b/src/info.rs index f43b608..a1cc581 100644 --- a/src/info.rs +++ b/src/info.rs @@ -1,8 +1,17 @@ -use scraper::Html; +use scraper::{Html, Selector}; pub async fn info() { - let _document_info = get_webpage().await.expect("Can't reach info website."); - // println!("{:#?}", document_info); + let document = get_webpage().await.expect("Can't reach info website."); + + // Selectors + let sel_ul = Selector::parse("ul").unwrap(); + + // Find the raw infos in html page + for (i, data) in document.select(&sel_ul).enumerate() { + if [1, 2].contains(&i) { + println!("\n{} - {:#?}", data.value().name(), data.inner_html()); + } + } } async fn get_webpage() -> Result> {