|
|
@@ -84,14 +84,16 @@ queryArtDecoCardAlt n = runExceptT do
|
|
|
pvs <- runOne ":scope div.pvs-entity--padded" n
|
|
|
|
|
|
bold <- runOne ":scope div.t-bold > span[aria-hidden=true]" pvs
|
|
|
- normal <-
|
|
|
- mapExceptT (map ignoreNotFound) $
|
|
|
+ normal <-
|
|
|
+ ignoreNotFound $
|
|
|
runOne ":scope span.t-normal:not(t-black--light) > span[aria-hidden=true]" n
|
|
|
|
|
|
pure $ ArtDecoCardAltElement { pvs_entity: ArtDecoCenterHeaderAlt {bold, normal: normal} }
|
|
|
|
|
|
+ignoreNotFound ∷ ∀ a f. Functor f ⇒ ExceptT QueryError f a → ExceptT QueryError f (Maybe a)
|
|
|
+ignoreNotFound = mapExceptT (map ignoreNotFound')
|
|
|
where
|
|
|
- ignoreNotFound = case _ of
|
|
|
+ ignoreNotFound' = case _ of
|
|
|
(Left (QNodeNotFoundError _ )) -> Right Nothing
|
|
|
(Left q) -> Left q
|
|
|
(Right n') -> Right (Just n')
|