chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e21222
)
tests: fetch client id
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 22 Feb 2021 01:12:51 +0000
(
01:12
+0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 22 Feb 2021 01:12:51 +0000
(
01:12
+0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-otter.rs
patch
|
blob
|
history
diff --git
a/apitest/at-otter.rs
b/apitest/at-otter.rs
index c7648ba515b545b73eefd88db3ca8aed8d81d795..6940cc494070e7a8ff2c36a12cca26451a439904 100644
(file)
--- 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);
}
}