From: Ian Jackson Date: Mon, 22 Feb 2021 01:12:51 +0000 (+0000) Subject: tests: fetch client id X-Git-Tag: otter-0.4.0~375 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9fc29eb84284250cf80ec9178956ed9f006e5a71;p=otter.git tests: fetch client id Signed-off-by: Ian Jackson --- diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index c7648ba5..6940cc49 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -24,8 +24,14 @@ struct Player { impl Player { #[throws(AE)] fn connect(&self) { - let body = reqwest::blocking::get(&self.url)?; - dbg!(&body); + let body = reqwest::blocking::get(&self.url)?.text()?; + let dom = scraper::Html::parse_document(&body); + dbg!(&body, &dom); + let clid = dom + .select(&"#loading_token".try_into().unwrap()) + .next().unwrap() + .value().attr("data-ptoken"); + dbg!(&clid); } }