From 9fc29eb84284250cf80ec9178956ed9f006e5a71 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 22 Feb 2021 01:12:51 +0000 Subject: [PATCH] tests: fetch client id Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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); } } -- 2.30.2