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
566 B
Rust
Raw Normal View History

2022-08-12 19:55:28 +02:00
use scraper::{Html, Selector};
#[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(())
2022-08-12 19:01:29 +02:00
}