Compare commits
No commits in common. "b9c7a79afc7f74014d84a26ae31384266e4df7f5" and "185585be039dd6dcc42fe843cf06b3d58f7a8296" have entirely different histories.
b9c7a79afc
...
185585be03
4 changed files with 3 additions and 1532 deletions
1508
Cargo.lock
generated
1508
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -6,6 +6,3 @@ 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"
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# cal8tor • **cal**endar P**8** extrac**tor**
|
# cal8tor • **cal**endar Univ Paris **8** extrac**tor**
|
||||||
WIP
|
WIP
|
||||||
|
|
22
src/main.rs
22
src/main.rs
|
@ -1,21 +1,3 @@
|
||||||
use scraper::{Html, Selector};
|
fn main() {
|
||||||
|
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(())
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue