mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-04 02:34:11 +02:00
handle roster history without steam group
This commit is contained in:
parent
22366e957f
commit
c81cc2f717
5 changed files with 2460 additions and 10 deletions
|
|
@ -49,16 +49,10 @@ impl Parser for TeamRosterHistoryParser {
|
|||
fn parse(&self, document: &str) -> Result<Self::Output> {
|
||||
let document = Html::parse_document(document);
|
||||
|
||||
let steam_group = document.select(&self.selector_steam_group).next().ok_or(
|
||||
ParseError::ElementNotFound {
|
||||
selector: SELECTOR_STEAM,
|
||||
role: "team steam group",
|
||||
},
|
||||
)?;
|
||||
let steam_group = document.select(&self.selector_steam_group).next();
|
||||
let steam_group = steam_group
|
||||
.attr("href")
|
||||
.unwrap_or_default()
|
||||
.replace("http://http", "http");
|
||||
.and_then(|link| link.attr("href"))
|
||||
.map(|href| href.replace("http://http", "http"));
|
||||
|
||||
let history = document
|
||||
.select(&self.selector_item)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue