Compare commits

..

3 commits

Author SHA1 Message Date
b9c7a79afc
load html file 2022-08-12 19:55:28 +02:00
8bdb83a406
add dependencies 2022-08-12 19:54:53 +02:00
b94d33a35f
typo 2022-08-12 19:54:39 +02:00
4 changed files with 1532 additions and 3 deletions

1508
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -6,3 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
reqwest = { version = "0.11" }
tokio = { version = "1", features = ["full"] }
scraper = "0.13.0"

View file

@ -1,2 +1,2 @@
# cal8tor • **cal**endar Univ Paris **8** extrac**tor** # cal8tor • **cal**endar P**8** extrac**tor**
WIP WIP

View file

@ -1,3 +1,21 @@
fn main() { use scraper::{Html, Selector};
println!("cal8tor");
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
//let url = "https://informatique.up8.edu/licence-iv/edt/l3.html";
// Get raw html
//let html = reqwest::get(url).await?.text().await?;
let html = include_str!("../target/debug.html");
// Parse document
let document = Html::parse_document(&html);
// Find the timetable
let selector = Selector::parse("table").unwrap();
let raw_timetable = document.select(&selector);
println!("{:#?}", raw_timetable);
Ok(())
} }