def parse_title(dom: XmlResponse) -> Title:
name = pipe(
dom
, html.xpath("//TITLE-TEXT")
, text.titleize
)
number = pipe(
dom
, html.xpath("//TITLE-NUM")
, text.split(" ")
, seq.get(1)
)
children = _parse_divisions_or_articles(number, dom)
url = _source_url(number)
return Title(name, number, children, url)
view raw parse_title.py hosted with ❤ by GitHub

Deixe um comentário

Descubra mais sobre Eduardo is testing

Assine agora mesmo para continuar lendo e ter acesso ao arquivo completo.

Continue lendo