Fix: correctly parse flight code
This commit is contained in:
parent
b115dd55a4
commit
e916f8628b
|
@ -97,9 +97,11 @@ class Details(object):
|
|||
This function fills the fileds related to the flight code,
|
||||
if present and the input matches some heuristics.
|
||||
"""
|
||||
code = h5.text.strip("\t\n ")
|
||||
if len(code) > 0 and "flight-numb" in h5.attrib.get("class", ""):
|
||||
self.code = code
|
||||
if "flight-numb" not in h5.attrib.get("class", ""):
|
||||
return
|
||||
child = h5.xpath(".//strong")
|
||||
if len(child) == 1:
|
||||
self.code = child[0].text.strip("\t\n ")
|
||||
|
||||
def maybe_parse_airport(self, h5: et._ElementTree) -> None:
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user