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,
|
This function fills the fileds related to the flight code,
|
||||||
if present and the input matches some heuristics.
|
if present and the input matches some heuristics.
|
||||||
"""
|
"""
|
||||||
code = h5.text.strip("\t\n ")
|
if "flight-numb" not in h5.attrib.get("class", ""):
|
||||||
if len(code) > 0 and "flight-numb" in h5.attrib.get("class", ""):
|
return
|
||||||
self.code = code
|
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:
|
def maybe_parse_airport(self, h5: et._ElementTree) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user