This repository has been archived on 2024-05-23. You can view files and clone it, but cannot push or open issues or pull requests.
cal8tor/src/main.rs

22 lines
569 B
Rust
Raw Normal View History

2022-08-15 12:18:08 +02:00
use scraper::Html;
2022-08-12 19:55:28 +02:00
2022-08-15 12:18:08 +02:00
mod timetable;
2022-08-12 21:20:39 +02:00
2022-08-12 19:55:28 +02:00
#[tokio::main]
2022-08-14 12:44:36 +02:00
async fn main() {
2022-08-12 19:55:28 +02:00
2022-08-15 12:18:08 +02:00
let _timetable = timetable::timetable(3, 1, None).await;
2022-08-12 21:20:39 +02:00
2022-08-15 12:18:08 +02:00
let _document_info = get_webpage_info().await.expect("Can't reach info website.");
// println!("{:#?}", document_info);
2022-08-12 19:01:29 +02:00
}
2022-08-13 17:27:35 +02:00
2022-08-15 12:18:08 +02:00
async fn get_webpage_info() -> Result<Html, Box<dyn std::error::Error>> {
/* let html = reqwest::get("https://informatique.up8.edu/licence-iv/edt").await?.text().await?;
2022-08-14 12:44:36 +02:00
2022-08-15 12:18:08 +02:00
Ok(Html::parse_document(&html)) */
2022-08-14 12:44:36 +02:00
2022-08-15 12:18:08 +02:00
let html = include_str!("../target/debug2.html");
Ok(Html::parse_document(html))
2022-08-14 12:44:36 +02:00
}